Set auto-lock on macOS after couple of minutes of inactivity that cannot be changed by the user

Solution 1:

I am adding one more option:

From System Preferences > Security & Privacy > 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.

enter image description here