Set auto-lock on macOS after couple of minutes of inactivity that cannot be changed by the user
I am adding one more option:
From System Preferences &gt; Security &amp; Privacy &gt; General tab,  click on Advanced... from where you can set up the inactivity timer as you want and enable administrator option. Any other standard user can't access other system-wide preferences setup too. So I guess this option will easier for you.