"Of all time" is REALLY hard-- much like with music, it changes with my age and how well things hold up. I don't watch much TV anymore-- pretty much all I am watching now is Doctor Who and American Gods. I currently have 22 episodes of The Flash on my DVR that I might get to someday. Maybe. But off the cuff I'd have to say:
1) Firefly 2) Buffy the Vampire Slayer (argument could be made for "superhero" but not a traditional/mainstream one, so I am leaving it) 3) Doctor Who 4) Star Wars: The Clone Wars 5) Sons of Anarchy
I also agree with anthony- on both BSG (old and newer) and Deadwood. Very solid choices. Also with Kross on X-Files and Star Trek:TNG--those would also be runners up for me. I need to get around to watching Orphan Black-- been meaning to for years. For comedy, I loved Scrubs. Not sure if I'd go back and watch the series again, but I always stop if I stumble across an episode on TV. The best comedy I've watched lately is Netflix's "Wet Hot American Summer: First Day of Camp" prequel series-- my primary takeaway being that Paul Rudd doesn't age and therefore must be a vampire.