My personal preference is that after fairly brief refit, command of the Enterprise was turned over to Will Decker and he took her out again. Years and many missions later, Decker brought the Enterprise back to Earth (by this time Kirk is already CoSO) and the rebuild process began.
Except Scotty believed that Decker was untried, which wouldn't be the case if he had already commanded the ship for a lengthy period of time unless it was a very boring mission where nothing really happened.
I think as much as seven or eight years could've passed between the series and TMP. McCoy may have retired but Kirk and Spock could've went onto other duties within Starfleet. Kirk serving as a Starbase commander and Spock and Scott doing work with Starfleet R&D on all the technological discoveries found during the Enterprise
's five-year mission. That work may have lead to the Enterprise
we see in TMP. Sulu likely served on another vessel as second officer, Chekov went back to school then served on smaller craft for a time and Uhura worked with Starfleet Intelligence.
was likely handed to another crew after the end of the series and the beginning of her refit prior to TMP. Heck, you could almost fit a second five-year mission in there.