Check System Preferences, then Security & Privacy, then General tab, click "Advanced.." at bottom, see if "log out after xxx minutes of inactivity is checked.
Also check System Preferences, Energy Saver, click on "Schedule..." at bottom for sleep / shut down / etc settings.
Report back if that solved your issue.