they put it in the shitty photon torpedo
A head, as it is called in naval parlance, is beyond the door on the starboard alclove on the Galaxy-class bridge; presumably, heads can be found in the crew quarters.
There was also a bathroom on plans of the Enterprise-D inside of Picard's ready room, it was never shown on screen. A toilet was never shown on screen, but sinks, showers, and sonic showers were. At least one known crewmember (Deanna Troi) had a bathtub.
Until Star Trek: First Contact, the producers of Star Trek tried to deny that it was necessary to use the bathroom at all, lest Picard or Riker be caught taking a leak or dropping a load when the Romulans attacked. ProfessorTrek 01:42, July 1, 2011 (UTC)