Ah ok. sorry for the bad advice then
In this case it could be the PSU (power supply unit), Ram, or overheating.
When the computer crashes bad enough sometimes its set to just turn off instead of displaying an error message. This is good if its a one time thing however if it keeps happening then you will want to use the information to diagnose the issue.
Try turning off the automatic shut-down on system failure by following these steps listed here
Automatic Restart XP - How to Disable the Automatic Restart on System Failure in Windows XP for XP and here
Automatic Restart Windows 7 - How To Disable the Automatic Restart on System Failure in Windows 7 for vista and 7.
If you dont feel comfortable opening the case of the pc it may be worth downloading speed fan and seeing what temperatures the computer is giving. Post the results back here.
Also you could download a copy of memtest (google it) and burn it to disk from another pc if possible, then just insert it into the pc that keeps turning off and let it run and post back the results.
However if you want to open the case then read on.
In your case it can be the same problem. But as its a desktop it will be easier to fix. If its a standard size computer then all you need to do is either unscrew the two screws at the back of the desktop for the left panel (when looking from the front) after this slide the left panel back and it should come off.
If its a dell then you may have a tab at the top that you need to pull back and the side will pop out from the top and then you can just lift the cover off.
After you have access im sure there will be a fair amount of dust. Get a hoover and on a fairly low suction give the computer a clean out being carefull not to be too harsh on the components.
You will see a big fan and metal heat sink, this is the part that cools the Processor and if this gets too hot then it can cut the computer out (as your experiencing). Make sure that the metal heatsink does not have dust trapped between the metal and the fan. If so try and get the hoover and clean the dust away.
Alternatively if the dust is not too bad it may be the PSU (power supply unit) that may be going bad. If this is the case you will need to get yourself a new one
First things first, try giving the internals a clean out and see how you go.