First off, what are your machine specs?
When the machine "switches itself off", is this a full shutdown? Does it go through the shutdown process or is the shutdown instant? Do you have to unplug the computer, then plug it back in to start it up again? Does the motherboard LED's stay lit when it shuts down? Does the machine automatically reboot?
What OS are you running?