Now, some shows, like "Firefly", and to a lesser extent, "Jeremiah" and "Babylon 5: Crusade", were unjustly killed off for no good reason before they could reach an ending. "Crusade" was already a spin-off in a universe of many possibilities, and the the fact that it was cut off at the knees (and the "Legend of the Rangers" series never made it past pilot) is a shame because as a franchise, it should have gone on for a long time. "Jeremiah" was rushed into an unsatisfying ending when the studio kicked JMS out of the project, but at least it had some kind of ending.
"Stargate SG-1" had a good run, and indeed, may have gone on a season or two too long as it was, but again, spin-offs were possible. "Atlantis" was good, not as good as the original, but good enough to keep the concept alive. ("Universe", from all accounts, is useless, though.)
Some shows should absolutely have a definitive end. "The Prisoner", for example, no longer has any need to continue once Number Six finally figures out what's going on.
Some very few shows have it built into themselves to continue forever. "Doctor Who" is the prime example - the decision they made, when they replaced Hartnell with Troughton a few years into its run, to not try to make him the same, but to encourage the differences, allows the show to continually re-invent itself while sticking with the same basic concepts and backstory (and with time travel involved, changing the backstory when they need to isn't all that different).
If you want a show that goes on forever, they’re called “Daytime Soaps.”