If needed a dog can hold it's urine for up to 14 hours but that really is too long to have your dog hold it's urine in.
You should always take your dog out to pee as often as possible because if the dog hold's it's urine in for too long it can lead to urinary tract infections and even bladder cancer.
Smaller dogs may only be able to hold their urine in for maybe an hour or 2 before they have to relieve their bladder.