After more than 15 years covering everything Apple, it’s with a heavy heart we announce that we will no longer be publishing new content on iMore and the iMore forums will be closing as of November 1st, 2024.
Unless the game has the function to lock it built into the game, you can't.
If you are worried about unauthorised in-app purchases, you can set Restrictions in the settings of your device to block those unless the person enters a PIN code.
Otherwise, the only thing you can do is to passcode lock your device.