For what it may be worth, here is my experience. I have a mid-2011 27" iMac. Under OS X 10.6.8, I never had any issues with the display. I didn't upgrade to Lion, but I did upgrade to Mountain Lion. For me, that's when the issues started. I started a thread about it here ( https://discussions.apple.com/thread/5148923?answerId=22865181022#22865181022 ) but never gota resolution. Even after upgrading to Mavericks, the issue persisted. I noticed that if I didn't let my iMac go to sleep at all, that would help the issue somewhat.
Reading through this thread, I thought I would comment on my personal experience with some of the possible causes.
Temperature: For me, this was not an issue. My iMac is in a room that is anywhere between 70-80 degrees Fahrenheit and I've had the iMac display randomly turn off independent of the room temperature. That is, keeping the room cooler didn't keep the iMac display on.
Video card: This too seems to not be the issue for me. I have two external monitors connected to my iMac and when the iMac display goes blank, the two external monitors work just fine. There's no hiccup or anything, just the iMac display going dark. Additionally, I took my iMac in to the Apple Store (by the way, the 27" iMac is a pain in the butt to lug around!) for the 1TB hard drive replacement program and also for the AMD GPU replacement program. The hard drive was replaced, but the Apple techs said that the GPU was not eligible for replacement because it didn't fail when they ran the diagnostic. They said they would only replace the GPU if it failed under a specific test.
Backlight: This did not seem to be the issue for me. When my display went black, even if I shined a flashlight into the iMac display, there was nothing. I couldn't see a faint trace of anything, it was just black.
Software: So far, in my case, this seems to be the most likely culprit. I did a clean install of Mavericks after getting my iMac back, and it's only been half a day, but so far, my iMac has been able to go to sleep and wake up with no display issues. Previously, upon turning on my iMac, the iMac display was guaranteed to intermittently or permanently (for that boot cycle) go black within an hour.
Previous to doing a clean install, I tried all the normal things to fix the issue, including repairing disk permissions, resetting the SMC, unplugging external displays, etc...but none of those worked. So for those of you still experiencing this issue, as much as a pain it may be, a clean install might be worth a shot.
If the problem returns for me, I will report back.