The bash shell provides an environmet variable that allows you to control the maximum number of seconds it will wait to automatically logout.
For example try to set the TMOUT environment variable to an integer value and login to your system. Once you are logged in, bash will wait for input the time specified by this environment variable. If the time is exceeded, the shell exits.
Simply add the following to one of your initialization files (i.e. /etc/profile) or try it from the prompt:
TMOUT=120
According to this, after 120 seconds bash will exit. From bash man pages:
TMOUT If set to a value greater than zero, TMOUT is treated as the default timeout for the read builtin. The select command terminates if input does not arrive after TMOUT seconds when input is coming from a terminal. In an interactive shell, the value is interpreted as the number of seconds to wait for input after issuing the primary prompt. Bash terminates after waiting for that number of seconds if input does not arrive.
To unset the environment variable simply try:
TMOUT=0