First place I'd look for clues is the Event Logs: Start > Run > eventvwr.msc
to fire up the Event Viewer, check the various logs for anything reported
around the times this happens.
Could also be overheating - check fans are spinning freely, vents are clear
and there's a clear flow of air around the machine. If possible, maybe run
with the side/top off with a fan pointed at the innards, see if the problem
goes away. (I'm not proposing that as a solution, more as a troubleshooting
step!)