|prime95 can be set to stress the CPU only, or to include RAM stress tests as well (obviously though, for the test to run it needs at least some RAM).|
typically (although not always), CPU functionality is all or nothing - either it works or you can't even boot to BIOS. Sometimes a CPU or motherboard will reset if temperatures get too high, to protect against damage. Have you had a look inside the case for dust? if it is really dusty, get a can of compressed air and spray the heck out of the inside of your case, especially around the CPU heat sink.
The next thing to do is test your RAM. download memtest86 and install the app onto a floppy, then boot to it (if no floppy drive, i think there's also a way to do it from a USB or optical drive). Test every stick of RAM by itself. If any of your sticks fail, replace them (make sure to chose RAM that is known to be compatible with your current motherboard).
if all your RAM passes testing, post back with as much info as you can find about your power supply, including manufacturer, wattage, number of 12v rails, and the amperage of the rails.