I found the following article in my archives, and I know there are others on the Internet. Clearly, many men would like to be able to hold their pee longer for various reasons.

Absent from this article are ways to restrict the penis/urethra, which is the last line of defense for a male. I've seen suggestions that would be painful or potentially damaging which I will not relate here, but most forms of pressure or manipulation should be harmless and might buy you a little time.
\
https://www.askmen.com/money/body_and_m ... it-in.html
It happens to all of us at one time or another: You have to take a piss, and it's just not a convenient time to do it — so you hold it in.
You might be at a bar talking to the right girl, but it's an early and precarious situation, so you can't risk losing her attention or allowing another guy an opening by walking off to the bathroom. Or you're at a close ballgame, the clock is winding down, and you'll be outraged at yourself if you walk away now and miss some spectacular play.
In most instances, holding it in won't do you any harm. Yet, if you do it frequently, you can indeed develop some health problems. For example, although the risk is low, holding it in can present a danger that you could develop a urinary tract infection (UTI), although men are less likely than women to develop one thanks to physiology (namely, a longer urethra). However, among the consequences of having a UTI is a rectal exam — reason enough to not make it a habit.
To that end, we present 4 steps to hold it in.
step 1
Relax
The first step to hold it in is to relax. Don't get yourself overly concerned about your bladder bursting or about developing additional potential health problems by holding it in at this moment.
Many stories about exploding bladders are myths, and worrying about them will only exacerbate the urgency. Among the most well-known examples is 16th-century astronomer Tycho Brahe, who is alleged to have died from a bladder bursting after holding it in for too long. Despite being disproved again and again, this myth persists. Brahe died over 400 years ago; no one in their right mind could possibly accept the contemporary account of his death, considering that medical knowledge in his era was as blind and stupid as it was.
With the exception of sustaining some serious physical trauma, you'll piss your pants long before your bladder bursts, so relax if you want to hold it in.
step 2
Stop drinking
As obvious as this may seem, it's important to keep in mind, especially if you've been drinking alcohol. As Cecil Adams of The Straight Dope made clear, alcohol not only kick-starts the urine production process as a diuretic, but it also contains an anesthetic so you don't know exactly how full your bladder is or how badly you need to go until you really, really need to go.
Bladder capacity varies widely from guy to guy, with the top end being something close to a quart — which in beer terms translates to two pints. However, you'll likely get the urge to go well before that. The bladder is made to expand — just don't keep drinking and ask too much of your organ.
Hold on just a bit longer, there are a few more steps to follow when you are trying to hold it in...
step 3
Eliminate additional bladder pressure
On its own, the pressure is bad enough; don't make it worse by the way you are sitting or standing. The male bladder is roughly located behind the pubic bone, so leaning forward while sitting will put added pressure on it. Crossing your legs seems like an old stand-by but, physiologically speaking, this too is a bad move because of the added pressure you put on your bladder. Leaning back won't do you any favors either.
If you're sitting, your best bet is to sit up straight like you would if you had good posture. The same goes for standing. In short, show as much discipline as you can and keep your torso in a strictly vertical position with regard to the ground if you want to hold it in.
step 4
Distract yourself
When push comes to shove and things get desperate, the physical aspect of a full and angry bladder can be bad, but the psychological aspect can be far worse — brutal, even. If you're in a situation where you have to hold it in, the last and arguably most effective step will be to distract yourself with unrelated thoughts. Don't dream of that satisfying moment standing over the urinal or hidden in the dark confines of an alley; don't focus on the bartender as he or she pulls another pint; block out the sound of the waterfall in the lobby. In short: Get your mind as far away as you can from thoughts of water flowing downward, in any context. It sounds cliché until you're in that position, and then there's nothing cliché about it. Rather, it's nothing short of torture.
No matter where you are, there are other things you can focus on to distract your mind. Use those, and hold out a little longer — long enough for you to finally get the chance to let it out.