The lifespan of the Sun and the solar system is determined by the natural processes of stellar evolution. While it is difficult to predict the exact duration, scientists have developed models that provide estimates based on our current understanding of stellar physics.
The Sun is currently in the main sequence phase of its life, where it fuses hydrogen into helium in its core. It has been estimated that the Sun is roughly halfway through its main sequence lifespan, which is expected to last about 10 billion years in total. This means that the Sun has approximately another 5 billion years left before it exhausts its hydrogen fuel.
As the Sun ages, it will undergo significant changes. As the hydrogen in its core becomes depleted, the Sun will start to evolve into a red giant. During this phase, the outer layers of the Sun will expand and engulf the inner planets, including Earth. However, estimates suggest that this expansion will occur several billion years from now.
Eventually, the Sun will shed its outer layers, creating a planetary nebula, and leave behind a dense, hot core called a white dwarf. The white dwarf will continue to emit heat and gradually cool over an extremely long period of time.
As for the solar system itself, its ultimate fate will be tied to that of the Sun. The gravitational interactions within the system will be disrupted as the Sun evolves, and the planetary orbits will be altered. Some planets may be engulfed by the expanding Sun, while others may be flung into new orbits or ejected from the system entirely.
In summary, the Sun is expected to remain in its current state for another approximately 5 billion years, and the solar system will undergo significant changes during that time.