Yes, there is a GPO setting for it located in computer config. You can set it to close out both idle and disconnected sessions after a certain amount of time
Computer Config\Admin Templates\Windows Components\Terminal Services\Sessions
'Set Time limit for active but idle Terminal Services sessions'
'Set time limit for disconnected sessions'