OS X 10.9.4 closes application when sleeping
It sounds like your Mac is set to automatically log you out after a period of inactivity.

Open System Preferences from the Apple menu in the top-left corner. Open the "Security &amp; Privacy" preference pane. Click on the "Advanced..." button in the bottom-right corner. You may need to unlock the pane using the padlock icon in the bottom-left corner.

I think you'll find "Log out after XX minutes of inactivity" ticked. Untick it.