Open Group Policy Management on the server in question and navigate to:
User Configuration > Policies > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits
Enable the item named: Set time limit for active but IDLE Remote desktop service sessions.
Select the desired time limit for the inactive session.
Enable the item named: End session when time limits are reached.
This setting will be responsible for the user Logoff after the inactivity period is reached.
To save it you'll need to close down the Group Policy Editor.
Afterwards, The system will give a warning message 2 minutes before disconnecting the Remote desktop session.
EDIT: I forgot to mention that you'll need to create a new GPO. Then right-click to edit it, and follow down the path I mentioned above.
If you find this answer useful, please up-vote and accept as the solution so that other Q/A users' can easily find solutions to related issues. Thanks.