I have recently started having a problem with my laptop shutting off when it's told not to do so.. this occurs when I play games like Garry's Mod or CS:GO. This has never been a problem since 2 days ago. I believe it may be the CPU overheating, my graphics card, or that I ran out of RAM.
You are right, most probably your PC is overheating. Install some software that monitors working temperature. If your processor is overheating you may need to add some thermal paste or check the cooling fans.