The planets in our solar system have been holding their orbital positions for billions of years. The exact time each planet has maintained its orbit varies, but they have been relatively stable for a very long time.
The formation of the solar system is believed to have occurred around 4.6 billion years ago from a giant molecular cloud. As the cloud collapsed under its own gravity, a rotating disk of gas and dust formed, known as the protoplanetary disk. Within this disk, planets began to form through a process called accretion, where smaller particles collided and stuck together, gradually growing larger.
Over time, these protoplanets further accreted matter, eventually becoming the planets we observe today. The early dynamics of the solar system involved gravitational interactions between the forming planets, which caused some orbital migration and rearrangement. However, once the planets settled into their current positions, their orbits have remained relatively stable for billions of years.
The stability of the planets' orbits is due to the balance between the gravitational forces exerted by the Sun and the planets themselves. The Sun's gravity keeps the planets in their orbits, while the planets' own gravity interacts with each other in complex ways but generally maintains their overall stability.
It's important to note that while the planets have held their general orbital positions for billions of years, there can be minor variations due to factors such as gravitational perturbations from other celestial bodies, tidal forces, and long-term effects such as the gradual changes in the Sun's mass over its lifetime. Nonetheless, these variations are relatively small compared to the overall stability of the planets' orbits over cosmic timescales.