What are the cause of computer system restart or shut down itself?

The 'Re-Start' could be caused by a virus. Vheck out you system using Norton Anti-Virus or some other virus checking program and see if there is a bug in yours. The automatic shutdown could also be caused by a virus or it could be in your system setup under 'Power Schemes' and the thing is actually going into Hybernation or Stand-By, but from the first part of your question, you should look more at a virus as the cause.....