Planets form in a protoplanetary disk; the gas and dust surrounding a newly formed star. These disks are dynamic environments, in which many different physical processes are at work. While it is important to consider each of these when building complex physical models, I will try to answer this question by focusing on just one: radial drift.
Radial drift is the phenomenon whereby dust particles orbiting the star feel a 'headwind' due to the gas in the disk. This causes them to lose angular momentum and drift in towards the star. The larger the particle, the greater the effect, so as particles grow larger through collisions they drift in faster. This is just one of the physical processes that puts a time limit on the lifetime of the disk. The disk will eventually dissipate and leave no material left for planetary formation.
We can get an idea for the lifetime of a disk by first measuring its mass. This is harder than it sounds, because most of the disk is composed of molecular hydrogen, which is essentially undetectable. Many studies instead focusing on more detectable species such as isotopes of carbon monoxide. The total disk mass can then be inferred by relating the amount of carbon monoxide the the amount of hydrogen through a known ratio.
Once the mass of the disk is calculated, we then need to estimate the timeframe for disk dissipation, given that mass. We find that, on average, a protoplanetary disk tends to last around 5-10 million years. So when we say that planets form at the 'same time', we mean within this same 5-10 million year period. This is of course a very short time period when compared to the billion year(s) lifetimes of stars and planets.
This is not to say that all planets form 'together' during the disk stage. The timescale of formation for any given planet is highly dependant on its location in the disk and which materials it is formed from.