Someone said :
I watched a cool video on how, if the sun were to disappear and Earth and all the other planets were flung into Outer-space, all life on the surface would die within a few months. But micro-habitats living deep under the ocean that get there energy and oxygen from geothermic activity, would carry on living for all of eternity until it were destroyed by a cataclysmic event such as the planet getting ripped apart by a star or black hole.
The problem with that is, this only works on a celestial object the size of Earth or bigger (big enough to have geothermic activity from which to draw life giving energy). It cannot work on an asteroid or even a small planet. For example Mars is too small and has too weak a liquid core to stop the surface being constantly radioactively sterilized by the Sun and in general exposed to raw, unprotected outer space. It's not got the geothermal activity Venus and Earth have.
That's why you can't just send a billion gallons of compressed atmosphere to Mars along with fertilizer, seeds and water; Radiation from the sun (the stuff our Ozone and other atmospheric layers protect us from) would obliterate life in about 1 hour, and the atmosphere would slowly leak away into space too.
Any smaller, like an asteroid or comet, and life would have no chance, These objects are basically violent, frozen, atmospherically defenseless and completely sterile rocks that habitually come close to a star and all but blow themselves apart before disappearing of into out space again.
Ahem without the sun the earth would freeze it wouldn't be a question of months