How to resolve weird auto-logout issue?
Isn't it the advanced log out feature found under Advanced in Security &amp; Privacy?

I've disabled "Log out after # minutes of activity" on El Capitan (see screenshot) to keep my desktop session open regardless of time.

I did check the "Require an administrator password" to prevent normal users to change a locked system.



You might also want to check your Energy Saver settings; particularly under the Schedule... button that could cause your system going to sleep.