TOS: Gene Roddenberry
TNG: Gene Roddenberry (first two seasons), Rick Berman and Michael Pillar (third to seventh season)
First off, the title "showrunner" wasn't in use in the '60s, so it's anachronistic to apply it to TOS. A showrunner is the writer-producer who's in charge of the writers' room, and they didn't have writers' rooms yet; they basically just had the producer and the story editor, with a large contribution by freelancers. But Roddenberry was the head writer in seasons 1-2, and essentially did the job of what we'd now call a showrunner, in that he rewrote every script to keep their voice and continuity consistent. Freiberger took over that role in season 3.
In the animated series, D.C. Fontana was the story editor, which for animation was basically the equivalent of a showrunner.
As for TNG, Berman was never really the showrunner, since that means the head writer. Berman mostly handled the logistical side of the production, the stuff other than writing. Of course he had final approval over the writers' decisions, but he did little actual writing himself. Michael Piller (note the spelling) was the showrunner from seasons 3-5, with Jeri Taylor running the room in seasons 6-7 when Piller moved over to DS9. Piller initially ran DS9, but Ira Steven Behr took over as showrunner by the end of season 3 and stayed in that post until the finale.
Michael Piller ran
Voyager on and off for its first couple of seasons -- he left to produce the Richard Dean Anderson Western
Legend, then returned for a while after its cancellation -- but he was in more of a supervisory capacity, with Jeri Taylor running the writers' room on a day-to-day basis. Once Piller left for good, Taylor ran the show from seasons 3-4. Brannon Braga was showrunner in seasons 5-6, with Kenneth Biller taking over in season 7 when Braga needed to focus on developing
Enterprise.
On ENT, Berman and Braga were the showrunners; it was the first and only Trek series where Berman contributed regularly to the writing process and worked as Braga's writing partner. But in season 4, Manny Coto took over as the ground-level showrunner (much like Taylor's position in early VGR), heading the writers' room while answering to Berman & Braga.
Also what was going on with the TOS and TNG movies in terms of who was in charge of them?
Movies are generally less a writers' medium and more a directors' medium. In TV, it's the writer-producers who are there the whole time, while directors just come in for a week at a time. But in feature films, the dominant creative voice is usually the director, in partnership with the producer, who isn't necessarily a writer, but usually was in the Trek films. (Oddly, in movies the executive producer rank is below the producer rank, the reverse of television.)
TMP was produced by Roddenberry. Harve Bennett was the producer in charge of the writing on movies II-V, though he only had executive producer rank on TWOK with Robert Sallin as the producer. Ralph Winter produced TUC. Rick Berman produced all four TNG movies. And the films' directors are pretty well-known.
So Feiberger should be blamed for the lack of quality of TOS's season three?
He has been the scapegoat for the past 40-odd years, but that's really a little unfair. Just about all the writing staff from seasons 1-2 had moved on, and Roddenberry had pretty much abrogated his responsibilities to the show, not bothering to contribute substantially to the writing in season 3. So Freiberger and his story editor Arthur H. Singer had to take over the show from scratch without any guidance from their predecessors, any help in getting a handle on what the show was and how to approach it. That's not a great situation to be dropped into.