Which will destroy the Earth first: the Sun or Jupiter? The sun is expected to grow in brightness over time, slowly heating the Earth until the oceans evaporate, leaving the planet uninhabitable.
Jupiter is the source of the largest perturbations to Earth's orbit. In general, the 3 body problem (and higher) is not stable. So we can expect Jupiter to, eventually, perturb Earth's orbit until Earth falls into the sun or gets kicks completely out of the solar system.
So, which do we expect to kill the Earth first: solar baking or orbital chaos?
I found an article by Ian O'Neill posted on May 2, 2008 at universetoday.com with the title Could Jupiter Wreck the Solar System? which says

But here’s the kicker: There is only a 1% chance that these gravitational instabilities of the inner Solar System are likely to cause any kind of chaos before the Sun turns into a Red Giant and swallows Mercury, Venus, Earth and Mars in 7 billion years time.

This is clearly after the time when the Sun is becoming a red giant in 4.5 – 5.5 billion years - this is the number given in an article Will Earth survive when the sun becomes a red giant? by
Matt Williams from 2016.
References
The first post is refering to a scientific article On the Dynamical Stability of the Solar System by Konstantin Batygin and Gregory Laughlin.