Sometimes, you might need to have your Terminal Services Server to terminate idle sessions to avoid server load, or vise versa as you might need to prevent the server from terminating your sessions if you would like to run processes over night, to configure such settings, follow steps below:
1. Go to your server Administrative tools.
2. Locate “Terminal Services Configuration”
3. Click on “Connections”
4. Right click “RDP-TCP” and select properties as shown in the image below:
5. Click on “Sessions” tab and configure this settings:
Hope that helps.