apologies but have copied this from someone, sure there will be more replies, interesting for all that.
Without the Sun, it would be about 8 minutes before we noticed it was gone.
The Earth would not instantaneously freeze at that moment. Our atmosphere is a very excellent insulator, temperatures would be tolerable for several days, several months if you bundled up.
We also have a lot of climate controlled environments... heaters in our cars, furnaces and fireplaces in our homes, insulation in the walls and attics. Think about it. When it is -30 degrees Fahrenheit, and you turn off your furnace, it takes nearly a week before the temperature inside of your house dips below 32 Fahrenheit.
Many people would survive several months. The major downfall for humans is this event would completely compromise the food chain. Plants need light from the Sun, and soil that is not frozen solid to grow. Without plants, virtually everything we eat, or everything that is eaten by everything we eat, will starve to death.
The last surviving human would be the one that had a cupboard full of non-perishables, rationed them out well, had a good heating system in the home that remained operational, and fantastic insulation in the home. I would say, best case scenario, someone could last a little over a year if everything fell into place just right, during such an impossible event.
Note, some extremeophile bacteria could continue to survive near the ocean floor, near heat vents generated from inside of the Earth.