This is an annoying behaviour, when quitting Photoshop it would unexpectedly quit (sounds odd, I know, but I prefer "expected" quits!) While this is annoying, there is no harm done if all documents were saved and closed first. If the following Plug-in is removed, the unexpectedly quit problem does not happen.
Note 1: This means open the "Applications" folder, then the "Adobe Photoshop CS5" folder, then the "Plug-ins" folder, then the "Extensions" folder, then find the file "ScriptingSupport.plugin", and delete it.
Note 2: If you require scripting support do not delete this, but you will have to put up with the unexpected quits. If you are unsure, move the file to another location, instead of deleting it, then you can put it back if required.