http://revach.net/article.php?id=3872

Section: Halacha   Category: Daily Halacha
The Obligation To Go To The Bathroom
The Shulchan Aruch (OC 3:17) says that if you hold yourself back from relieving yourself when needed, you are oveir Ba'al Tishaktzu.  There is debate among the Poskim if this issur is Min HaTorah or MiDirabanan.  The Mogen Avrohom (103:4) holds that it is MiDirabanan.   The Mishna Brura (31) brings from the Pri Megadim that if you hold yourself back because of embarrassment, you are not oveir.  Additionally if you hold yourself back from passing gas you are not oveir this issur.

The She'arim Metzuyanim BaHalacha brings from the Divrei Chaim of Sanz that the  average man typically goes three hours before needing to releive himself and he need not rush to the bathroom based on imaginary needs.  Furthermore he says that Hesech HaDa'as, not thinking about it, also helps.

Important Note: We try to convey the Tshuva to the best of our ability. We admit that our understanding may not be accurate. One should learn the tshuva to verify the accuracy of our interpretation.  Please also understand that this Tshuva may not be the final word on this topic. One should consult a Rav before drawing any conclusions.