Three Months. According to the DS9 episode Valiant, the training cruise of the ship was to "circumnavigate the entire Federation" and Collins said that
The training cruise was supposed to last three months.
Bear in mind, the vessel was limited to warp 3.2 until Nog fixed the engines.
Why the speed discrepancy? Because it's Star Trek.
In Where No One Has Gone Before, the Enterprise is hurled 2,700,000 light years to the far side of Triangulum. Data says it will take over 300 years to return ship and crew to Federation space. This breaks down to approximately 9,000 light years per year at maximum warp.
At that speed, Voyager should have been home, without outside assistance, in less than 8 years but it is often repeated that it will take them 75 years to travel 70,000 light years meaning Voyager travels less than 1,000 light years per year...This implies that the Enterprise is more than 9 times faster at maximum warp.