In my experience after drinking a cup of coffee I have to pee within 15 to 20 minutes.
So going by that I would say that the coffee leaves my stomach within 10 to 15 minutes or 20 minutes and then winds up in my bladder causing me to need to urinate.
This is why I avoid drinking too much coffee when I'm driving on a long road trip when bathrooms are few and far between because coffee goes through me really quick.
Some people may have the coffee in their systems a little longer but for me it goes through me really quick.
So you could drink a cup of coffee and then set a timer to see how long it takes you to need to pee and then that would be about the time it takes for the coffee to leave your stomach.
Coffee with caffeine is a diuretic which means that it makes you urinate so you can expect to pee soon after drinking coffee or anything else with caffeine.