ideally, you should still be warmed up after the aerobic workout.I would not wait for more than 10 minutes until I stretch.
The idea is to have very warm tissues and to have less adhesive tissues. The longer you wait the less advantageous stretch will be for improving flexibility. You can continue to move at a less intense level for a while, but it must at least keep body temperature up. If you were to stop exercising/moving all together (sitting or lying down for example) and not stretch within about 5 minutes, I would recommend performing a warm up of about 10 minutes (longer if you will be stretching muscle or muscle groups that are habitually tight).
OK, first of all, I see you wrote “cool down,” as part of your question.
If you’ve just done aerobics, and your heart rate is significantly higher than your normal heart rate, you need to bring your heart-rate down as part of your cool-down. A cardiovascularly fit person’s heart rate might return to normal within a few minutes, and it will take longer for someone who is less cardiovascularly fit. Especially if you’re a beginner or you have any type of issues with your heart, this part of the cooldown should never be ignored, and it comes before stretching.
As for stretching, the information you’ve received is sound. The sooner the better. If there is a pause between cardio and stretching, I’d suggest stretching each muscle for a longer time, at least 30 seconds rather than the typical 15-20.