When a baby or toddler poops their diaper it should be changed within a few minutes after they're done pooping the diaper.
Sometimes you may not be aware of the diaper being pooped in right away so it's okay if you don't happen to notice for awhile but as soon as you notice the poop diaper you should change it right away.
Leaving a poop diaper on a child or baby too long can result in a serious rash.
If baby happens to poop at night in the diaper then it's okay to let the baby sleep through the night and then change them in the morning when they wake up.
Toddlers skin can usually handle an overnight session in a poop diaper without needing it changed.