This is very frustrating and so many people seem to have the problem. I'm a 2010 27" iMac user. I am a little surprised that Apple didn't issue a product recall. It also makes me nervous about ordering parts on eBay because how far along are they from failure, too?
At the moment, I have El Capitan installed, having firstly gone back to Snow Leopard just to see if the problem exists there, too, which for me it does. I have tried so many of the suggested quick fix solutions but none have worked, sadly, though I greatly appreciate all of the suggestions given.
Clearing the PRAM briefly seemed to work but only for a minute or so. The only way I can get the iMac screen not to go completely black is to have the brightness set to its lowest point. If it's a very cold day, I can have it around 20% higher than that but not for long.
This model has had so many problems, for me, including the noisy Seagate hard drive. I am going to strip down the iMac and replace the thermal paste on the CPU and graphics card, which I should have done long ago, the temperatures were a little higher than other users and, in my opinion, when under load for long periods, are really too high for long term stability of the iMac. I resorted to using the iMac as a screen for a computer but it still got very hot. Like a lot of people with the 2010 27" model I have cloudy areas on the screen from dust that requires very carful surgery (ribbon cables) and aluminium tape (does anyone know what tape Apple/LG use) to remove that dust.
I hope the next generation of domestic iMacs feature the same cooling system that the iMac Pros use and that there is some concession made to people who want to upgrade memory and storage. It's unlikely that my replacing thermal paste and re-seating cables will make a difference (to the blackouts) but I will report back, either way. The iMac is long enough out of warranty that it seems worth a go.