When you open ‘gpedit.msc’ from a Run-window or command prompt you can walk through the tree to ‘Computer Configuration’ -> ‘Windows Settings’ -> ‘Security Settings’ -> ‘Local Policies’ -> ‘Audit Policy’
There check the boxes for Success and Failure for ‘Audit logon events’ and ‘Audit account logon events’.
There’s a good chance you’ll see relevant events appear in the security event log from the time you were automatically logged out about why you got logged off.
For more information on individual events and what they mean you can copy paste the event ID, source and/or eventdata in your favourite search engine or ask here (be sure to remove personally identifiable information you don't want to share)