Modifying this control will update this page automatically

Set your Mac to log out when not in use
You can set your Mac to automatically log out the current user after a set period of inactivity. This helps ensure that your information is secure when your Mac is unattended.
On your Mac, choose Apple menu
> System Settings, then click Privacy & Securityin the sidebar. (You may need to scroll down.)
Click Advanced at the bottom.
Turn on “Enable stealth mode”.
Click the “Log out after” pop-up menu, then choose the amount of time before the user is automatically logged out.
See alsoPut your Mac to sleep or wake it