The Sun does not have enough mass to explode as a supernova. Instead, in about 5 billion years, it will enter a red giant phase, its outer layers expanding as the hydrogen fuel in the core is consumed and the core contracts and heats up. Helium fusion will begin when the core temperature reaches around 100,000,000 K and will produce carbon, entering the asymptotic giant branch phase.
Earth's fate is precarious. As a red giant, the Sun will have a maximum radius beyond the Earth's current orbit, 1 AU (1.5×1011 m), 250 times the present radius of the Sun.[90] However, by the time it is an asymptotic giant branch star, the Sun will have lost roughly 30% of its present mass due to a stellar wind, so the orbits of the planets will move outward. If it were only for this, Earth would probably be spared, but new research suggests that Earth will be swallowed by the Sun owing to tidal interactions. Even if Earth would escape incineration in the Sun, still all its water will be boiled away and most of its atmosphere would escape into space. Even during its current life in the main sequence, the Sun is gradually becoming more luminous (about 10% every 1 billion years), and its surface temperature is slowly rising. The Sun used to be fainter in the past, which is possibly the reason life on Earth has only existed for about 1 billion years on land. The increase in solar temperatures is such that already in about a billion years, the surface of the Earth will become too hot for liquid water to exist, ending all terrestrial life.
So the safe answer is 5 billion years. If you like to live dangerously, you can consider disposing of your tax records after one billion years, when all life on earth is expected to be extinct. But I wouldn't recommend it.
“The” + “IRS” = “Theirs”