It's stored in the database. You can set it through Site Administration/Server/Session Handling
It basically determines how long a person can be logged in and do nothing (no page loading) before they get automatically logged out. If you set this to low, it can cause students/teachers to lose work if they spend to long typing in a window (forum, assignment, providing feedback, etc.) before they submit their work. I have most of my sites set at 1 hour.
Steve