The obvious questions such as a possible virus infection.
Try booting in safemode and see if it randomly shuts down..... what programs load on startup?
Download and install this in safemode....
http://www.malwarebytes.org/mbam.php
to a quick and/or full scan... see what happens