Barring the Earth being destroyed by an asteroid or other calamity, the world is projected to end in about five billion years. This is about the length of time required for the sun to burn its hydrogen.
When the sun uses up its hydrogen, the next step is for it to start to burn its helium. When the helium is gone, scientists expect the sun's core to shrink while its outer layers expand, resulting in the sun becoming a red giant. When this happens, it will swallow the Earth and completely destroy it. What will be left after the red giant phase might be a planetary nebula that might collapse into a white dwarf and then a black dwarf.