How long a show gets in terms of its episode count is a very important thing, because it can tell you just how popular the show is, or, the true intent of the show. You look at something like NCIS, and they’re about to get their 20th season this fall, and the way their show is built allows for that. But then you look at something like The Good Place, which went 4 seasons of 13 episodes a piece (thus 52 in total) and you’d think that would be bad…and yet, that was their intention the whole time, to tell a short and concise story. Then, you get into superhero shows like The Flash and it’s a whole different metric.
Why? Because The Flash is part of the now basically defunct Arrowverse, the one started by the show Arrow and the branched out into Flash, Legends of Tomorrow, Supergirl and so many more. Arrow itself lasted 170 episodes over 8 seasons, with the final episodes coming via a shorter season to help setup Crisis on Infinite Earths (the crossover event that would kill Oliver Queen).
Fast forward to now, and Flash has just ended his 8th season on the CW, and has now passed Arrow as the longest-running show in the Arrowverse.
Which at first, might seem like a “well, duh” moment. Except, you need to remember that Season 6, 7, and the now finished 8 were all affected by the global pandemic and the desire to have shorter seasons to ensure completion of things. Arrow got done before the pandemic happened, thus, it went 7 full 23-episode seasons and then shorter one for 8. Flash didn’t have that consistency.
Either way though, with the Season 8 finale, it’s reached 171 episodes. Plus, Season 9 is confirmed, so its run will continue on.
Source: Wikipedia