I've had a similar experience. I bought a 24" iMac with a Geforce 8800 GS back in May 2008 and it worked great until Halloween this year. On that day, artifacts began appearing on the screen, whether in Windows or Mac OS, and every time I attempted to launch a program that would access the video card, the computer crashed. I took it to an authorized repair place, where they replaced both the video card and the logic board, and returned it to me nearly two weeks later. The computer died again, with the same exact symptoms, within a few hours.
Figuring it was an overheating issue, I booted into Mac OS X while it was still able to boot, and found that iStat was reporting some strange numbers: 65° C for the GPU diode, and 42° for the GPU heatsink. I figured the repair place had failed to attach the heatsink properly, so I decided to drive much farther this time, to an actual Apple store. Within 3 days (compared to 10 days with the other place!), they called me back saying that they had replaced the logic board and video card again and that it was STILL not working correctly, so they decided just to upgrade me to a 27" iMac. So perhaps it wasn't the previous repair place's fault, but I was glad that the Apple store worked so quickly.
However, I have some remaining questions. First, I assume your iMac also had an 8800 GS. Perhaps this model is plagued with the same doomed-to-failure defect that affected the 8600M? I remember Apple or nVidia releasing a statement showing that the 8800 GS (or really the 8800M GTS) was not an affected card, but perhaps nVidia was still covering it up. Second, which version of Windows had you installed? My iMac began having issues one week after I installed Windows 7, and I was frightened that it was the cause. However, I'm not sure of that anymore, but it would be an interesting correlation.
Lastly, I definitely recommend Applecare, even for a desktop, to anyone who questions its value. I know that I would have had to pay for my iMac to be repaired twice already and that it would still have issues. And I was a proud owner of the May 2005 built-in-Shanghai 17" Powerbook, with the defective Bridget-Riley screen issue. For that, I had not purchased Applecare, which I regret very much. It has been rotting in my basement for years now and Apple will do nothing for it.