I had a very much alike problem with my computer the last week or so. What u mean to say is that after some time your monitor display goes off and the light keeps flashing and keyboard and mouse wont respond right.
As Czhang said it could very much likely be a HD problem. You might also want to check up on the following :
1 ) Check for dust accumulation inside your Cabinet
2 ) Overheating Ram and GPU (unlikely as you haven't mentioned that you run graphically demanding applications like games )
3 ) Or Least likely ( motherboard, CPU or your PSU/SMPS ( Power Supply ) problem.
You wouldn't believe what i went throught to get my system repaired. Finally i'd to go for a cpu replacement and it's functioning smoothly now (well almost
) . Hope this helps. Good luck.