Eventually, the Sun will run out of fuel, go dark, and other bad things will happen. About how much long is it predicted that we will have a sun functioning as it is currently?
According to Wikipedia:
However, the Sun has more nasty tricks up its sleeves:
So, it's going to take long enough that we don't really have to worry about it.
Just to add to Undo's answer, after the expansion to a red giant, the sun will become a planetary nebula, where (according to the link) the fusion reactions inside the star are 'overtaken' by the gravitational collapse, in turn causing the inner layers to condense and heat up causing the outer layers to be blown away. After which, the hot core forms the remnant, a White Dwarf star (NASA source), which is likely to last for several more billions of years.
The image below depicts the current ideas of the expected lifecycle and timeline of the life of the sun:
How do we know what will happen to the sun?
Currently, the main method to determine the solar lifecycle is described by the article "The Future of the Sun" (Cowing, 2013) is to:
Where the mass and chemical composition of a star provide the information needed to determine its lifecycle.