The laptop shuts down on its own when playing games. All other times it works fine.
Possible troubleshooting steps and repair solution:
Most likely the laptop shuts down while running games because it overheats. When you run a game, you push the CPU to the limit and it generates a lot of heat. If the laptop cooling module (fan and heat sink) is clogged with dust, the laptop will overheat and shut down.
Make sure the cooling module is clean. Remove dust using canned air or air compressor.
Apply fresh thermal paste on the processor if needed.