This problem has been driving me crazy for over a year now. The Geniuses at the Apple Store don't seem to have the solution. They run a series of tests and tell you the logic board is at fault. Twice they have replaced the video card as well.
Like a lot of people, this has started when I play World of Warcraft. The design of the iMac is poor, and it does not filter out heat efficiently from the video card. That's where the primary issue lies IMO, and unless you want to cut a hole in the casing and put a fan in there, you are probably going to continue having these issues for the life of your iMac when doing a lot of video intensive stuff, such as WoW.
The results of the lack of heat dissipation are logic board, video card/video ram failures. I've had it all replaced twice in the past year at my local Apple Store. They have replaced the logic board a 3rd time. I hope you have apple care, because like someone said, it's almost $1000 per pop if you don't. I'm so glad I did make that investment. I've had over $3000 in repairs to my $1800 iMac.
The first thing I did when I started having problems, based on a conversation with Apple Tech Support was install SMC fan control. I found out running WOW on the default fan settings caused an internal temp of around 140 degrees after about an hour of playing. Not good for any computer electronics. I maxed out the fan speeds, and before I had the 1st logic board replaced, I was still getting temps of about 110 - 120. So, if you are having issues already, SMC is not going to fix them. Now, after the 3rd time, I still run SMC, but I still get temps in the 105 range with a good (or at least new) logic board immediately when starting up WOW, and I still start having video issues after about an hour or less of playing. SMC is NOT a fix for this issue if you are playing WoW.
If you run tech tool deluxe after playing WoW, you will see that your video ram fails tests.
Just my opinion, the logic board is what goes bad first, but it's only a symptom of the problem, and replacing it is not the solution. But until someone at Apple is willing to go past only treating the symptom, and starts looking for a solution, then you (and everyone else) are going to continue having problems. This was my first iMac, and I love it for some things, but it's very obvious that if I want to continue gaming, an iMac is NOT the product for that.