I am pretty sure there's a word for it, but I forgot what the word was completely. By "urge to go to the toilet", I mean the desire to go peeing or pooping obviously.
There is the phrase "caught short". In the Oxford Dictionaries is
be caught short
1.1 British informal Urgently need to urinate or defecate.
those caught short in the store will have to pay £1 to use the toilets
There is no single word for this. The actual expression varies between English dialects, but in the US it's common to say something like:
I need to go the bathroom.
If (for whatever reason) you want to be more descriptive, you can say something like
I have a full bladder.
Naturally, there are dozens or perhaps hundreds of slang expressions for this, most of them fairly crude.