Your "graphics card" is an chip on the motherboard. It's possible for the chip to fail- which would entail buying a discrete (seperate) graphics card, or another motherboard with onboard graphics.
Before you get to that stage I would check the tempreture of the CPU.
Firstly, check to see if the heatsink/fan is clogged with dust. If it is I would recommend at the very least blowing the dust out with a can of compressed air or electrical contact cleaner.
If you haven't already, download a utility like
CoreTemp. And monitor your processor tempreture at idle and while gaming.
If the system is turning off due to the CPU's thermal tolerance being reached, then you may need to reseat the CPU - a fairly painless operation. You will need some thermal paste (to renew the old paste), some cleaning (isopropyl) alcohol and cotton swabs to remove the old paste.
At this stage I would check the temps first, and then attempt to eliminate the possiblities for crash causes one at a time -as the cause could be power supply or RAM failing.
On restart after a shut down, are you greeted with a blue screen or a white script on black screen alerting you to any problem?
Does the shutdown only occur during gaming?