How many hours does your dog hold his pee at nighttime in his crate?

My puppy is 6 months old, I put him out at midnight then I get up at 3 or 4 am. The weather is extremely cold , he's on antibiotics for a uti, I am concerned it's from the crate