My late 2006 iMac started to freeze and have graphics issues after about 18 months of use. It turned out that this was an overheating problem experienced by a lot of users. smcFanControl made the computer noisy, but didn't stop the problem, especially in the summer. I'd had the iMac sitting (unused) on a desk for a while, and was going to throw it out...but instead, I tried making a few ventilation holes, as seen in this picture.
If you want to do this yourself, you'll have to locate a service manual for the iMac (20-inch Late 2006); try a PDF search on Google. Follow the instructions in the manual, and take almost everything out of the computer. Next, drill some holes in the back with a hole saw -- the important holes are marked in the above-linked picture. Finally, install smcFanControl, and crank up the fans.
This modification makes the computer loud, but the processors consistently run at 35 Celsius, and the computer
doesn't crash. I haven't tried turning down the fans yet, but it's been running for weeks without a problem.
[robg adds: I would not advocate this solution myself -- I'd either take it in for service, or donate it to someone else who could have it serviced. However, to each his/her own, and the above solution is basically free.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20100117025218440