To configure policies that apply to your end users devices you would first need to have them enroll in InTune or be joined to an on-prem Active Directory domain.
If you need details on enrolling windows devices in InTune we have this here - https://learn.microsoft.com/en-us/mem/intune/user-help/enroll-windows-10-device
If your devices are already enrolled, you can create a Windows 10/11 configuration profile, and manage the setting under the "Max Inactivity Time Device Lock" policy, we have guidance here on these parameters - https://learn.microsoft.com/en-gb/windows/client-management/mdm/policy-csp-devicelock
If your devices are managed via on-prem Active Directory you can use the following Group Policy - https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/interactive-logon-machine-inactivity-limit
Note: For this policy to take effect the users device, must be restarted after the policy has been applied.
Do let me know if you have any further questions, I would be happy to help!
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.