In-universe, the episode “Ensign Ro” established the precedent of TNG-era Starfleet crew wearing (presumably) regulation undergarments – in her case, a division-colored tank-top tucked into her trousers.
This concept would eventually evolve into the plethora of gray Starfleet T-shirts and tank-tops worn underneath the standard uniforms throughout the subsequent two spinoff series and TNG movies.
In production-verse, though, the cast wore tight, low-cut T-shirts or tank tops (possibly akin to exercise shirts) underneath their jumpsuits.
Despite their low necklines, sometimes the undershirts accidentally poked up from underneath the jumpsuits.
It appears the cast – or at least, Patrick Stewart – sometimes wear gray undershirts instead.
In the TNG season 7 special feature, “Dressing the Future,” Marina Sirtis took the audience on a tour through the costume department.
Walking past a massive rack of Starfleet uniforms, she paused and pointed out the underwear worn by the cast, describing the bras as “adding inches where there are none.”
She also presented an example of typical male underwear, skin-tight “bower-briefs,” noting that they couldn’t have a “visible panty line” on their uniform.