If you remember JAG, which is in the same "fictional universe" as NCIS, the last few episodes were setting up the protagonists to get promoted and become guest stars, introducing new characters, played by lower paid actors. CBS passed and cancelled the show.
However, JAG generally hovered in mid 20th place and never was higher than 15th, and was doing its second year in the "Friday Night Death Slot", ranking in at 59th place. NCIS has been no lower than 3rd place, often 1st, for over a decade and a half, and shows no sign of losing viewers, even though the consensus is that the show has lost its edge. I think CBS would try to keep the show alive, even if Harmon quit.
How to work Gibbs in to some but not all episodes will be a challenge. How a disgraced former officer needs to show up four or five times a year to help out is a stretch, even in the total suspension of reality world of NCIS.