The solar system did not form all at once.
We know that the Sun started shining about 5 billion years ago, but the planets came afterwards.
Astronomers estimate that Earth was likely formed some 4.6 billion years ago and that the other planets, asteroids, and satellites coalesced at about the same time.
It is safe to say that the solar system as a whole is about 4.6 billion years old.