Could be heat, could be spyware, could be a million other things.
Backup up your important data. There is probably no quick fix for this.
The quickest thing to check is to remove the battery from the laptop and run on just A/C power. One of my laptops had a battery that went bad and caused this behavior. I just had to run it on A/C power. Since it was not my main laptop, I never bought a new battery to see if it was battery specific.
The rest of these are time consuming, if you choose to attempt them. If you have a backup computer, you should use that while working on the laptop.
To test the heat thing, boot the computer into safe mode. For XP, push the [F8] key as the system begins to boot and the system should present a boot menu, select Safe Mode with Networking. This just loads the bare software needed to boot Windows and enable networking. This will also allow Internet access if you have an always-on connection. Your printers and most new software will not run. If it is a spyware/malware/virus problem, the computer will run fine. If it is a heat problem, the computer will shut down like it does when you boot normally. Obviously, this could take hours.
To test the spyware/malware/virus thing, go to http://housecall.trendmicro.com and use the free scanner. Delete your temporary internet files before running the scan this will save having to scan hundreds, if not thousands, of files. I have had this clean a computer when the installed virus product was compromised by malware. This to can take most of an hour, depending on the number of files on your computer.
If it is a heat thing, try a cooling pad. That is the only way I know to keep a laptop cool once the fans and vents are cleaned.
I have a laptop that started doing this and does it to this day. It will always run 30 minutes; sometimes it will run hours. It runs Win2000 and actually has a serial port, which has become a rarity these days. I use it to configure routers and firewalls with a command line interface over the serial port.
Sometimes laptops only last one year. It is my experience that I get about two years on average from a laptop, before it develops sporadic problems that make it undependable. I've had others last longer.
Hope that helps and good luck.
Jeff