Could be all sorts of things. Power supply would be the most likely and the cheapest and easiest to fix. Bad memory can also cause a shutoff as could overheating of the CPU (possible even if the fans are working fine). Overheating video card is a possibility but graphical anamolies would usually be obvious before the shutdown.