I think the shows with long term success either have multiple independent or semi-independent story arcs or they have a well defined story arc that lasts for the entire run of the show. The characters grow and change as the show progresses which keeps the audience interested.
Where they run into trouble is when the constraints built into the structure of the show limit the number of possible stories, but success leads to them trying to keep the show running after all possibilities have been used. At that point, the show becomes repetitive and boring.
Writing this, I'm reminded of the show, Scrubs.
Scrubs was an excellent show for the entirety of it's 8 season run. The concept allowed for a story arc that lasted the whole run, specifically the story of JD and his friends learning and developing as doctors from first year residents to attendings. There is a natural progression during that process that allows for individual growth of the characters and accommodates natural shifts in storylines to allow for new topics for episodes. In addition there are countless opportunities for different individual smaller story arcs to make each episode able to stand alone as it's own tale.
Because there was a built-in plan creating a structure for the life of the show, they were able to maintain quality and audience interest for all 8 seasons.
If the producers had foolishly tried to squeeze more seasons out of the show after they had exhausted the original concept, they would have inevitably failed. The result would have been a weak and pathetic shadow of the previous seasons and would have rapidly lost the patience of the audience.