Stellar Life cycle: We know that sun and other stars generate heat and radiation through nuclear fusion. Generally, there are several stages that a star would've to cross through its life so called the Stellar Evolution.
Our Sun (1 solar mass) is a Mid-sized Main sequence (specifically G-Type or yellow-dwarf) star. Nuclear fusion takes place between protons to form helium at this stage (Reactions are provided here). It's surface temperature is about some 5000 °C and core temperature is about $10^7 K$. As more and more hydrogen fuel is consumed, the layers of hydrogen are decreased simultaneously while expanding the shells filled with helium. Finally, the core begins to contract still expanding the helium layers and by this time, the core would've reached $10^8 K$ which is strong enough for the fusion of helium to produce carbon and by this way, the Triple-alpha process begins. During the expansion of Sun, we'd arrive at a time (about 3 billion years) when the temperature in Earth could no longer hold water and all lives would've been terminated. Also, The inner planets Mercury, Venus and Earth would've been engulfed by the expanding sun.
Wiki has a good comparison for Red Giant... Future of Earth article is also good.
A White dwarf: Once the triple-alpha process in a red giant is complete, stars weighing less than 4 solar masses (like our sun) don't have enough energy to ignite the carbon fusion process and then explode into a Supernova. So, The star collapses to a white dwarf until it's halted by the pressure arising from electron degeneracy. The Hertzsprung-Russell Diagram is a plot of luminosity vs temperature which shows the decrease in luminosity of stars with decrease in their temperature. A teaspoon of a white dwarf would weigh 5 tons. A white dwarf with one solar mass would be about the size of the Earth.
It has been estimated that it takes about 5 billion years for Sun to become a Red Giant. But, now we have much larger situations to concern at present like protecting ourselves from PHA's (Potentially Hazardous Asteroids) than thinking about near future. One thing to keep in mind is that, More brainy guys are out there to think of building something like the AXIOM in Wall-E..! So, humans have chances of survival if those physicists build some crazy items to be placed in our future inventory list.
This paper explains the survival of a planet named V391 Pegasi b from a Red Giant (but only as a roasted one..!)
Edit: Then, You don't require any of the above facties... The answer is: "How long would you stay in a desert..?". At about 1 billion years - Sun would be 10% more luminous so that organisms start dying due to Moist greenhouse effects (Water starvation). At about 1.6 billion years, Sun's luminosity is at about 40% and hence all Life on Earth dies due to Runaway Greenhouse effect..!