The length of time a puppy should be able to hold in it's poop depends on the puppies health, size and age.
A puppy that is at least two months old can usually hold in it's poop for up to two hours however you should try and take your puppy outside to poop more often so it will get used to going poop outside.
Puppies however don't have any control over their bladder and puppies will usually need to urinate every 30 to 45 minutes so be prepared to take the puppy out at least every 30 to 45 minutes to pee anyway.