Ok, there are lots of things that can lock up/shut down a computer, heat is only one of them.
You may have a bad power supply, bad ram, a bad video card, motherboard problems, even a bad power cord.
As a first step, I would shut the thing down, disassemble it and start cleaning things... Go to Radio Shack or an electronics supply outlet and get a can of contact cleaner (<i>cleaner</i> not lube... and don't even think about using anything but the right stuff).
Take out your AGP card and each of the PCI cards... spray the motherboard side of the connectors with cleaner --and use the stuff liberally, you want everything wet-- then sweep them inside, end to end with a fairly stiff brush several times (I have a paint brush I use for this purpose). Then clean the edge connectors on the cards themselves by sweeping along them with a soft pencil eraser (the pink ones) until the contacts are nice and shiny.
Next repeate the cleaning process with the Memory strips and sockets.
Now take off the Heatsink, take out the CPU and spray the socket down real good with contact cleaner... get it very wet and swing the locking arm back and forth several times while it is wet. Now spray the CPU pins and sweep them several times with the brush... But in this case be gentle, those pins bend real easy.
Finally, reinstall the CPU, and heatsink the way I described.
Next... fire it back up in minimum configuration... Keyboard, memory, cpu, heatsink, video... Do a BIOS Clear (see the motherboard manual for instructions.) Get into the BIOS and put everything on auto that will go on auto... Once that is done, get into the BIOS hardware monitor and watch the system for a couple of hours... Does the temp stay stable, do the fan speeds stay more or less stable, are the voltages all within 5% of ideal... does it lock up or shut down?
If you run into trouble with the minimum configuration, you have it narrowed down to a relatively small number of replaceable modules... Try subbing in different parts, one at a time and see if it stabilizes... try the video card first, then memory, then cpu... if none of them stabilizes it, it's likely the motherboard.
If you get it this far without a hitch... begin rebuilding the system one bit at a time and testing it after each new piece... hook up the hard disk, monitor it from the BIOS, then the CD-rom, then the PCI cards one at a time, checking and watching for a few minutes with each new piece, until you get it all back together and working.
If you run into trouble after adding a part back in, you got your bad part and from there it's just a matter of getting it replaced.
If you get this far with no problems, you should have very high confidence in your hardware. Most anything that goes wrong from here will almost certainly be software. Drivers are a common cause of shutdowns and lockups, so be sure you have all the most recent (or most reliable) drivers for your devices. On the outside, you may have to reload your operating system and software from scratch but, of course that is a last resort.
Once you think you've got it beat, run it for a few days, maybe a week, before you start tweaking and tuning in the BIOS... just to make sure.
Finally... there is a possibility there is a virus in your system causing this... get a good anti-virus scanner and use it if the problem persists.
--->It ain't better if it don't work<---