Documentation on resuming app after shut down

When I shut down the mac while my app is still running, my app relaunches the next time I launch the mac. The problem is the data I had just entered into my app before shutdown is not saved as it is when I Quit the app. I'm trying to better understand this automatic relaunch of open apps so I can address this issue. Where is the documentation? What are the key words?

Documentation on resuming app after shut down
 
 
Q