Check if your system is setting the environment variable TMOUT. To check this you can just do:
env | grep TMOUT
If it is set, you could change it or unset it. To change the value:
Where the number is the number of seconds until you get logged out. Otherwise unset it to turn off the feature:
Note, it may be that your system administrator has set this for security reasons. So if you are not the system administrator you may want to check this before changing anything yourself.