How long after Earth formed did the Moon form?
It is thought that it took some 20 to 100 million years for the Earth to form after the process of planet formation started in the Solar System.
Planet formation involves collisions between material in orbit around the Sun to form larger and larger bodies. One definition of a planet is that it has cleared its orbit of other bodies.
While the Earth nearly fully formed it was hit by another Mars sized planet. This causes a Big Splash and the ejected debris formed the Moon. The remains of the other planet merged with the proto-Earth.
Obviously the collision was a massive event which caused the Earth to gain mass and spin. Arguably the Earth as we know it and the Moon were formed at the same time as a result of the collision.