Yup. That's a default feature of Joomla. In the "Global Configuration" area of Joomla, find the "Session Timeout" parameter. Set that, in minutes, to the amount of time you want it to take to log the user out if they are inactive. The default is 15 (minutes) I believe.
That setting works for the front and back-end to determine when the user will be automatically logged out.
Hope that helps,
Alex