Introduction
With MAC OSX, you can set your computer to log out after a period of inactivity. This means all currently running apps close out as well as all documents which save in their current state through the Versions & Resume features. This is very useful when you don’t want just anyone to walk up to your Mac and have full access to your data.
Automatic logout helps ensure that your information is secure when your computer is unattended. It is also great for use in school computer labs and in situations where computers are shared. By automatically logging out an inactive user, the Mac becomes available for the next person to use.
To setup automatic logout, follow the below steps :
1. Open System Preferences. Do this by clicking on the Apple  logo  in the top left side of the screen and then click on System Preferences…
2. Click on Security & Privacy
3. Under the  General, click the Lock button so that you be able to make changes.
an authentication dialog box will open, where you will need to type an administrator username and password, then click Unlock
Once you authenticate, the Advanced… button will be enabled, click on Advanced…
4. Check the box next to Log out after [  ] minutes of inactivity and set your time limit. The default setting is 60 minutes
Set the required amount of minutes and then click OK
5. For added security, select Require password [ ] after sleep or screen saver begins and choose the amount of time before a password is required.
Watch the video below to see a demonstration of what we have done above :