This should happen automatically every time you close Aperture. That is is not happening indicates some problems with Aperture. Try repairing your Library after rebooting, then reboot again and see if it works as it should. If it doesn't, your next step is to delete your User Preferences. This almost always solves UI misbehavior.
Details on repairing your Library as well as on removing your User Prefs are on this Apple support page.
I find it is a good habit to close Aperture prior to putting any machine to sleep or shutting it down.