It kind of depends on the era. In the early years of TNG, while Roddenberry was still alive, the science was about as good as Trek science ever gets. Rick Sternbach and Mike Okuda were the main technical advisors and they made a good effort to keep the show grounded in real ideas. The astronomical phenomena depicted were often real, such as the periodic nova star in "Evolution," and even the more fanciful ideas were grounded in real concepts (for instance, the time warp in "Yesterday's Enterprise" was described as "a Kerr loop of superstring material;" that's an inaccurate use of "superstring," but otherwise the concept is grounded in real physics ideas, such as a Kerr ring singularity, something which does theoretically allow for time travel). For a while, the credited science advisor on the show was Naren Shankar, who's an actual physicist as well as a writer.
But once Roddenberry was gone, and once Bormanis took over as science advisor, the science began to get progressively more fanciful. Berman didn't care as much about good science as Roddenberry did, and just wanted a continuing stream of new gimmicks and technobabble, and Bormanis obliged him by coming up with an ever-lengthening stream of gibberish words (he seemed inordinately fond of fake words containing "-genic" and "-lytic," culminating in the catchall "isolytic," which was used for all sorts of things and has the nonsensical meaning of "equally dissolving"). Not that Bormanis wasn't trying; when he wrote the Voyager
episode "Demon," he scripted it as dilithium that the ship was low on, but Berman & Braga changed it to deuterium, which was nonsensical on many, many levels (it's one of the most abundant substances in the universe, it would never be found in any quantity on a superhot non-Jovian planet, and it has no liquid form except at incredibly low temperatures), because they enjoyed the conceit of a starship "running out of gas." So I'm sure Bormanis knows his stuff and wasn't the root of the problem, but he did strike me as kind of an enabler, given all the technobabble word salad he churned out.