If the user has not saved changes in the form they are filling out, and if you are using InfoPath Filler (i.e., the client application, not filling out the form in a web browser) when you add a rule action of "Close the form" you have the option of prompting the user to save their changes. See attached, which is from a browser form, thus the checkbox is disabled.