The Inactivity Timeout feature will log out the user after a period of time of inactivity. Various session activities, including active timers, will not allow the inactivity timeout feature to log out the user.
Enable Inactivity Timeout
Go to Setup > My Settings > Security tab > where it says “Inactivity Timeout in Minutes” choose the minutes by clicking the up and down arrows.
By default, it is set to 120 minutes (2 hours) but you can set this for up to 360 minutes (6 hours).