It's not harmful to hold it for a few minutes until you get to the bathroom, but if you wait too long, the effects can be unpleasant and even dangerous. Holding your urine for too long can weaken the bladder muscles over time.
Is it good to hold your bladder?
In most cases, holding in urine for a short period of time until there is a time and place to go is not going to be harmful. However, holding in urine is associated with a small increased risk of urinary tract infections. This is because the urine standing in the bladder can increase the bacteria growth there.
Can you damage your bladder by holding it?
Your bladder, a muscle, may even start to atrophy or weaken, leading to urinary incontinence, or poor bladder emptying." In rare and serious situations, holding urine for too long can lead to a bladder rupture.