Housetraining a puppy is a major time commitment, particularly because young pups have to poop significantly more frequently than adult dogs. Their small, underdeveloped bodies aren't able to hold it in as long, so even if your puppy knows the routine of going outside, he can't always help having an accident. By knowing how soon he has to go out after eating, though, you can help prevent regressive accidents.
When it comes to taking a puppy outside after a meal, timing is everything -- and it might not be very long before he has to relieve himself. While adult dogs can go for hours after a meal without pooping, a puppy will likely need to poop within five minutes to half an hour of his meal. Generally, the younger he is, the shorter the amount of time before he needs to go. Puppies aren't always able to control their bowels, especially when they're young -- until they're between 12 and 16 weeks old, they may not be able to hold it in at all. This is why you have to be patient when he has accidents and diligent about taking him out within a half-hour of a meal at the longest.
Develop a Schedule
Puppies learn from routine and consistency, so do your best to feed yours at the same time every day, and take him outside to relieve himself consistently, also. According to the ASPCA, when you start training your puppy, you should take him outside at least once an hour until he starts to form a habit. This diligence is crucial to your puppy learning the good habit of pooping outside, because the time between eating and pooping can be so unpredictable at first. If you take him out too soon after a meal and he doesn't poop, then he'll have another opportunity to do so within an hour or so.
Watching Your Pup
Because a puppy's bowels can be unpredictable, keep a close eye on him when you're inside -- especially after a meal. The amount of time it takes him to digest is likely less than an hour, so until he defecates, watch carefully for any signs that he is about to go. These may include sniffing the ground, circling or even squatting. If you catch him in the act before you make it outside, stop him, pick him up and take him out to finish.
Having an Accident
Puppies have accidents. It's bound to happen, especially because even a puppy that knows to poop outside can't always control his muscles. This is especially true after a meal, because the time it takes for him to digest can be unpredictable. If your dog poops in the house, you must not punish him, especially after the fact -- he won't understand, and he'll either come to fear you or work harder to hide his accidents. Instead, praise him when he poops outside. Puppies learn much more effectively from positive reinforcement than negative. When he grows into an adult dog, he can go about half a day before he has an accident -- this depends on the size of your dog, though, so ask your veterinarian for a more specific estimate.