The last numerical episode, #120, is Roger Moore. The last episode taped, and the one intended as the series finale, was the show with Gene Kelly.
There were a variety of factors for why the show ended. Jim wanted to end the show while it was still popular rather than wait for audiences to get tired of it. He and the writers felt they had done all they could in the half-hour variety show format, for the time being. Also, Jim wanted to move on to other projects. Those are some of the factors I remember.
David "Gorgon Heap" Ebersole