How long the universe remains habitable naturally depends on what happens to it in the future. Should it come about that it eventally shrinks, ending in a Big Crunch, this would mean an end to all forms of life.
But even in a cosmos that goes on expanding for all eternity- which is what seems likely if recent findings showing that expansion is accelerating prove to be correct - it seems certain that a time will come when life ceases to exist. In an ever-expanding universe, energy and matter will increasingly thin out so that there will eventually be barely enough energy to sustain life of any kind. Life processes could slow down to counter this, but nevertheless, at some point life reaches a limit beyond which it cannot go. All forms of life must be able to radiate energy,, and that is only possible when the environment is cooler that the life form itself. However, there is a lower limit for the temperature of the universe. Although it is only an unimaginably tiny fraction of a degree above the lowest possible temperature (absolute zero - 273.15 C), it is sufficient to deal the fatal blow to any remaining life.