There is no such way to restrict the remote access time (or remote session time by times of incorrect password).
1.For remote session with RDS roles, there are settings by GUI or GPO to configure the active session time.
Computer Configuration > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits.
2.For incorrect password by mistakes or other reasons, the administrator could configure the account lockout settings to disable the remote access for the user and manually unlock.
Configure remote access client account lockout
Hope this helps and please help to accept as Answer if the response is useful.