I assume your pc goes in sleep mode as you have described your problem. This happen for 2 reasons. Sometime the RAM isn't plugged into the slot properly, so you need to remove the RAM and plug again. Or you are having issue with your SMPS. SMPS is not supplying power to all components properly.
So you have to check first from your RAM and then SMPS.