How to troubleshoot and overheating laptop that shuts down due to overheating:
Your laptop processor generates heat, and if it gets too hot, it will damage the CPU and thus a shut down is required to prevent damage. Laptops have temperature sensors and BIOS settings to send a signal to the operating system to shut down when the heat passes a certain threshold. With these steps you can determine what the problem is:
Inadequate Ventilation:
If you have inadequate ventilation to the laptop, the CPU/Video card will overheat and the BIOS sends a signal to the OS to shut down. Make sure there is adequate ventilation to the CPU and video card. One way is to feel the keys on the surface keyboard, are they hot? If your laptop is kept on a soft surface which does not promote airflow underneath the laptop, then the laptop is more likely to overheat.
Dust bunnies:
Do not underestimate the clogging power of unseen dust bunnies. If the laptop is more than a year old or kept in dusty environment, then your ventilation system may be completely stopped. Dust bunnies coat the fan blades and metal heat exchange ducts. Don't take apart the laptop unless you are an expert. You can determine if this is your problem by sending a quick strong puff of air in the opposite direction that the fan blows. You can do this with your mouth, but don't spit. When you do this, a cloud of dust/smoke should come out the bottom of the laptop.
DON'T USE A VACUUM TO GET DUST BUNNIES OUT OF THE LAPTOP OR COMPUTER.
Your standard vacuum cleaner you get at walmart generates enough static electricity to destroy computers with a single touch. If you do use a vacuum cleaner, don't have its plastic touch the computer case. Use a vacuum specially designed for computers, or use canned air.
BIOS settings not up to date
The BIOS may not be updated as much as it can be. Go to the manufacturer or your laptop's website (in my case toshiba.com) and go to the download section for the relevant BIOS updates. You may get some new options to set the fan speed to go into "full power" mode at a lower temperature. This may be easier if you have dual booted your laptop with windows, you can download an EXE to flash the BIOS.
Damaged fans in the laptop
Do you feel air blowing out the exhaust port when the laptop fan is on high? If not, the fan may not be spinning at all or spinning at half speed.
Install a cracked/unlocked laptop BIOS to fiddle with fan settings
A cracked or "unlocked" laptop BIOS (found on overclocking websites) can give you options to custom set your fan temperature thresholds and settings. So you can tell your fan to go max speed all the time. As always, be careful with your BIOS options as this gives you the power to brick your CPU if it overheats and the OS doesn't respond by shutting down to prevent damage.
CPU/Video card Heat sensor failures
If the heat sensors are sending faulty readings to the BIOS, the a signal to shutdown the OS may be happening without reason.
Operating system problems
The reason the laptop is shutting down could have nothing to do with the heat generated. Depending on your operating system, there may be error logs you can find which log the error message.