- Open "Run" and type "gpedit.msc"
- Go to "User Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits"
- Double Click on "Set time limit for disconnected sessions" and select enable then set time to "X minute"