You can set your computer's hibernation time in Windows 11's Control Panel under Power Options. Before you can do that, you might need to enable the hibernate mode ...
If your laptop enters hibernation while you're playing games, there's likely an issue with your battery or CPU. Your laptop's CPU might be getting too hot while you're gaming, forcing it to shut down.