Have you looked in control panel under power options and checked that it isn't set to switch itself off. The other thing is it could be overheating, if you run the PC on something which isn't graphics intensive ie not a game something like word or the net is it ok? If it is and its only when you play a game or it runs for longer before it shuts down then I would check the temps first. On your motherboard driver disk there may be a temperature sensing program that you can use, if it is heat thats doing it then the computer is switching itself off to prevent damage and you need to address this, checking all fans etc and adding a new one if necessary.
I agree with the good advice of Totally-braindead. I had a similar problem which drove me crackers. It turned out to be a sticky fan on the Power Supply Unit which kept stopping and causing overheating so the computer took evasive action and shut down. A new one solved the problem.