My headcanon has been that it was between 6 months to a year between V and VI.
Even if the 1701-A was having problems during the shakedown, the tense political situation would have required the ship to stay out and active for awhile.
Despite the low casualty numbers (possibly zero) for the Alien Probe incident, the Klingons had two vessels neutralized by the probe, who knows if they survived, and if any died, they didn't die in glorious battle, so not exactly an honorable death, yet the Federation turns back the Probe. Combine that with the Federation refusing to extradite Kirk, Kirk and crew being cleared of charges, Kirk being essentially rewarded for his actions, Kruge's bird of prey sinking into the San Francisco bay and not returnable to the empire, tensions would be high.
Despite that Kirk wouldn't be the Captain they'd want on the Klingon border at this point, Starfleet would not be able to afford having a large starship like the Enterprise sitting in Spacedock unless the warp core was breaching, life support were offline and they're out of coffee.
After a few months, the problems with the ship would require a proper stay in spacedock, Starfleet in its infinite love affair with refits, puts the ship through changing the bridge and potentially many other areas of the ship, potentially pushing the repairs Scotty needed to do down the road. The refit crew finishes their work, most of the Enterprise crew takes shore leave, leaving Scotty and the skeleton crew to finish the repairs with little support.