The settings are in Group Policy.  Use gpedit.msc to set them as you want.

Under the Local Computer Policy\Computer Configuration\Administrative Templates\Windows Components\Terminal Services\Sessions folder, the following settings can be made:

• Set time limit for disconnected sessions
• Set time limit for active sessions
• Set time limit for idle sessions
• Terminate session when time limits are reached

Under the Local Computer Policy\User Configuration\Administrative Templates\Windows Components\Terminal Services\Sessions folder, the following settings can be made:

• Set time limit for disconnected sessions
• Set time limit for active sessions
• Set time limit for idle sessions
• Terminate session when time limits are reached