Could be cpu overheat if the heatsink isn't on correctly. Try getting speedfan to see what temperatures it's reporting. It could be a faulty mobo too. Look for capacitors with bulged or burst tops. If any are burst or have crusty stuff on them, the mobo is destroyed.
Also make sure the computer is running within specs. I've seen machines that have been messed with, and when it flakes out the owner conveniently fails to mention that they moved the jumper from "200" to "266" or whatever... Anyhow, make sure it's not being overclocked, FSB, cpu, or memory.