In that case, it could be the power management settings on the laptop.

You can check them by going to your control panel and then to power options. If there is anything in the "System standby" or "System hibernates" boxes, that may have caused it to turn off, especially if the laptop was running on battery at the time it turned off.
It may also have been a case of the battery simply running dead.

If it overheats, it will either suddenly switch off, actually shut down while in use or switch off and reboot instantly.
It can also suddenly bluescreen, and/or hard lock until you switch it off, but by default it will reboot, so unless you've had similar problems before, it's not likely you would have changed it.

If it is overheating, I hope it is still under warranty, because you can get it fixed for free.

If I were you, I'd back up my stuff, format the drive and reinstall Windows, just to be sure it's not a software problem.
Be warned that reinstalling Windows is not just a case of putting the disc in and reinstalling. That will install another Windows.
You need to format and then reinstall to have a clean drive.