When you say it is turning off, there are no fans spinning? No lights on? No vibration? If you hear fans spinning or see lights on, then it is Sleep mode as defriend suspected. Usually moving the mouse or pressing the Enter key will wake it up. If it is not waking from sleep, that is another issue.
But if the computer is shutting down on it's own, then it is caused by overheating or a failing Power Supply Unit. Turn the computer off, by either holding down the power button for 10 seconds or by shutting off the power switch in the back. Open the side of the case and clean out all dust and blow out all fans with a can of compressed air.
Look at the label for the PSU and report the Make, Model, and Wattage. Turn the computer on and make sure that all fans are spinning. If pressing the power button does nothing and you have to lie the computer on it's side, then you probably have a failing or under powered PSU that needs replacing with a 550 watt or better model.
But if the computer is shutting down on it's own, then it is caused by overheating or a failing Power Supply Unit. Turn the computer off, by either holding down the power button for 10 seconds or by shutting off the power switch in the back. Open the side of the case and clean out all dust and blow out all fans with a can of compressed air.
Look at the label for the PSU and report the Make, Model, and Wattage. Turn the computer on and make sure that all fans are spinning. If pressing the power button does nothing and you have to lie the computer on it's side, then you probably have a failing or under powered PSU that needs replacing with a 550 watt or better model.