|MadSci Network: Astronomy|
Firstly, I wouldn't be too concerned about the Sun going out. It has enough hydrogen fuel in its core to continue shining as it does now for another 5 Billion years.
Now, the Sun is the source of energy for most of the life on Earth. It is also the main source of energy for weather on Earth. The living things at the bottom of the food chain are mostly photosynthesizers (combining sunlight with carbon-dioxide to make food): blue-green algae and so forth. If for some magical reason the Sun were to suddenly be replaced by say a black hole of equal mass (just something that gives off no light). Then the algae would all die probably within a matter of days to weeks. I'm not a biologist so I can't tell you exactly how long they could live without any light whatsoever. Once they are all gone the creatures up the food chain would begin to starve to death. Again, I don't know how long this would take, maybe a few months.
Also, without the Sun's heat the Earth would begin to freeze. Temperatures would plummet to near -400° Farenheight as the Earth radiated its remaining heat away. This is all very bad for life as it requires liquid water at the very least for survival. I did a simple calculation of how long it would take for the Earth to cool to near absolute zero in such a case. It turns out that it would take about 2 weeks. This would cause the atmosphere to liquify and the oceans to freeze. The only things that might survive are sea creatures living near geothermal vents on the ocean floor. These creatures get their energy from the Earth's molten interior. The source of this heat is radioactive elements within the Earth's interior.
So in 2 weeks Earth would be a barren icy rock should the Sun suddenly go missing. Now, we humans might be able to save some of ourselves by generating heat through burning of fuels (like oil and such), and nuclear fusion. But we would have to act fast.
Again, I want to say that such a catastrophe is all but impossible. There are ways that the Sun's rays could get blocked from reaching the surface of Earth, such as a meteor impact or nuclear holocaust that spreads particulate matter into the atmopshere. But none of these would be as catastophic as the actual loss of heat from the Sun itself to the planet.
I hope that answers your question to some level. It's difficult to give any absolute answers to the question of how long life would survive under such a circumstance.
If you wish to ask me further questions, you can email me.
Try the links in the MadSci Library for more information on Astronomy.