If you know your toddler or baby has pooped in their diaper then you should change it as soon as possible to prevent a diaper rash.
However when my kids were in diapers they would soon poop after I noticed they had a dirty diaper.
So I would wait 10 minutes after they had a dirty diaper before changing them and during that time I would gather the supplies such as baby wipes, new diaper etc.
Then I would tell them it was time to change their diaper that would give enough time for them to finish pooping so I wouldn't need to change another diaper right after changing them.
If the child just peed in the diaper then you don't need to change the wet diaper right away and can wet until the child wets the diaper 3 to 4 times.
Toddlers usually need a diaper change every 2 or 3 hours and can usually go through 5 or 6 diapers per day.
Newborns will usually wet and poop more and may need 10 to 12 diapers per day but you don't have to immediately change a wet diaper.
But poop diapers should be changed as soon as you notice but give them at least 10 minutes to be sure they are done pooping.