There is a very low chance that it might do this. It could also be ejected from our solar system, or could hit Earth, or Venus. If this happens, then it's a few hundred million years from now.
It's because Mercury is a light planet, Jupiter is huge, and it just so happens that Mercury's perihelion precesses at almost exactly the same rate as Jupiter's. So when they come into sync, Jupiter could keep tugging at Mercury in every orbit amplifying its effect. Someone did a number of runs simulating future evolution of the solar system a good few years back and they found that in 1 or 2% of the cases or some such that Mercury gets thrown out of its orbit by those repeated tugs.
Apart from that, then as the sun goes red giant then that's about a billion years from now.
To put these time periods into perspective, half a billion years is long enough for humans to evolve from the simplest multi-cellular creatures. So the intelligent technological creatures of the future that may need to do something about, or in response to Mercury's orbital changes could easily be descendants of microbes that right now are just making the first steps towards multi-cellularity :).