You need to do some math, first work out what the max pop you can support based on the highest CC of the orbit. Then ensure you never have more infrastructure than what will support that max pop number, however your pop will naturally produce infrastructure as a trade good so their pop will increase. To counteract this you have to do some guess work and keep your shipped infrastructure amount suitably lower to allow for the increase. Finally you can set the work to stable pop only so it only grows through internal natural growth.
These combined tend to give you enough time to get it terraformed.
The natural increase in infrastructure is at a rate of
1% per year of the amount needed to hold the current population 2 infra per year per million population, modified by governor/sector Wealth Creation bonus, times your racial tech level for "Wealth Generation per Million TN Workers" divided by 100.
This rate is compounded per construction cycle, so you will get a very slightly higher result over a given time span than a single calculation based on the momentary rate would indicate.
If the amount of infrastructure already at the colony is sufficient to hold the current population, then the free infrastructure appears as an exportable trade good, rather than as available infrastructure.
In other words, you can't ship away the free infrastructure unless the population is using it.
At that point, if you aren't also shipping away population, shipping away infrastructure will cause the same overcrowding problem that you are trying to avoid, just at a lower population level.
If you really don't want to breach the max CC pop limit, you have to keep shipping away colonists.
For small colonies inside your gated network, this is challenging, because your civilian shipping lines will keep shipping more colonists there whenever there is enough free space to hold at least 50k pop, and a colony cannot be designated stable (or source) for civilian shipping until it reaches 10M pop (or half of the body's population capacity, if lower).
EDIT: Corrected free infra calculation to account for two things: racial pop growth density not equal to 1, and wealth creation modifiers.