Ever clean it? Typically when a computer shuts off instantly it's overheating. You can get utilities for displaying CPU temp, you might have one. You can boot to bios too which will display it. Should probably be around 30 degrees idling but that will vary... Max varies too, I think once you get by the 50 to 60 degree threshold is when most will shut down. It's safety feature so you don't fry the CPU.
Solution is to open the case up and blow the dust out particularly the heat sink for the CPU.
Be sure to unplug everything first including all peripherals. Once you open case touch a metal part of the case before touching anything inside the computer, this will discharge any static electricity. One zzzzzzzzzt, and you can probably kiss it goodbye.