I wrote about the fate of the Earth and the whole Solar System when the Sun dies some time ago, and yes the Sun will run out of energy, but not soon. You see, the Sun is made of hydrogen and helium, the energy the Sun emits is as a result of nuclear fusion reaction, where tons of hydrogen is converted to helium. Unfortunately, this process won't last forever as the Sun will eventually run out of hydrogen to burn.
On the bright side, this won't happen in our lifetime, as it is expected to take about 5 billion years for this doomsday event to unfold, the Sun has already its middle age, and has the other half of its life ahead of it.