Answer:
The era of planet formation ended when the remaining hydrogen and helium gas of the solar nebula was swept into interstellar space by the solar winds.
Explanation:
The Solar System is formed from a molecular cloud (compound by gas and dust). If there is a near perturbation to the cloud, maybe due to a supernova explosion, the molecular cloud will collapse under its own gravity. Then, in some point it starts to rotate and will accrete all the material in a disk around the protostar¹.
Inside the disk, dust particles start to collide and accrete until they form planetesimals². As a consequence of the gravitational force of the star, rocky and metallic particles will be more attracted to the inner part of the Solar System (close to the Sun) since they have more mass than gas.
Then, when the star has the necessary pressure and temperature to initiate nuclear reactions in its core, it will be able to emit huge amounts of energy, better known as solar winds. These winds will expel gas (hydrogen and helium) from the Solar System more easily than the rocky and metallic particles.
Notice that when such event occurs, rocky and gaseous planets were already formed.
Key terms:
¹Protostar: A young star.
²Planetesimals: Object formed by many fragments due to the gravitational attraction between them.