Possibly the RAM is going bad. Faulty RAM can shut your computer down. do you get any kind of error message ?
also, ( if using Windows XP ) click on the START menu, on lower left corner, scroll to MY COMPUTER and RIGHT click on it. Scroll down to PROPERTIES and click on that.. Click on the ADVANCED tab. Then click on the SETTINGS tab, under the STARUP and RECOVERY area. Then check the SYSTEM FAILURE section , and UNCHECK the AUTOMATICALLY RESTART box.
I would recommend, installing a new RAM stick(s). always make sure you get quality named Memory (RAM) such as, Kingston, or Crucial.
The cheap, no name RAM can sometimes cause problems, system crashes , etc.