I suspect this question would get more attention in a different part of the forum but my best guess is the machine is overheating. Are the cooling fans working? and have you cleaned them recently? (can of compressed air often works well). If the fans aren't working, a powered cooler pad may work for you (easy to find in newegg or tigerdirect)
If the hard drive is starting to die, more likely the computer would crash rather than shut I would have thought - although if I'm wrong please correct me!
hope that is some use