From Wikipedai:
“The television series (Gunsmoke) ran for 20 seasons from 1955 to 1975, and stands as the United States’ longest-running prime time, live-action drama with 635 episodes.
You are wrong. Also from wikipedia:
23 years
Death Valley Days
March 1, 1952 to August 1, 1975
558 episodes
So fewer total episodes, but broadcast for 3 seasons longer than Gunsmoke.
Gunsmoke does win for total years if you include the radio shows with Robert Conrad as Matt Dillon.