Hello,
Run gpedit.msc to open group policy,the session time limit policy is as follows:
Computer Configuration→Administrative Templates→Windows Component→Remote Desktop Services→Remote Desktop Session host→Session Time Limits
Set time limit for disconnected sessions:Use this policy setting to configure time limits for disconnected Remote Desktop Services sessions.
Set time limit for active but idle Remote Desktop Services sessions: Use this policy setting to specify the maximum amount of time an active Remote Desktop Services session can remain idle (without user input) before it is automatically disconnected.
Set time limit for active Remote Desktop Services sessions: Use this policy setting to specify the maximum length of time a Remote Desktop Services session can remain active before it is automatically disconnected.
End session when time limits are reached: This policy setting specifies whether to terminate Remote Desktop Services sessions that time out instead of disconnecting them.
If the Answer is helpful, please click "Accept Answer" and upvote it.