The auto-lock setting will be grayed out if Low Power Mode is enabled. This is because Low Power Mode automatically sets the auto-lock to 30 seconds. To find out more, check out our article on how to disable auto-lock on your iPhone or iPad.