Session Timeout after certain period of inactivity
You are looking for Automated Logout module.


  This module provides a site administrator the ability to log users out
  after a specified time of inactivity. It is highly customizable and
  includes "site policies" by role to enforce logout.


Features


Different timeouts based on role
Disabling of timeouts based on role
Permission for users to set their own timeout
Includes some JS mechanisms to keep uses logged in even if multiple tabs are open or if the user is working on a form for a long period of time.
Includes developer hooks to allow users to remain logged in depending on your own project specific requirements
Optional integration with Javascript Timer


(or) take a look at Session Limit

(or)

Ejector Seat


  A Drupal module to immediately log out (eject) a user whose session
  has ended