"The arrangement lasted five years, during which the boat went five times around the Continent."
Gatsby was with Cody for five years, a term of education and experience that are summarized in this chapter as leaving Gatsby with a "singular education" and having helped fill out the name of Jay Gatsby with the "substantiality of a man".
Gatsby met Cody as James Gatz. However, once Cody took the young man under his wing, Gatsby became Gatsby. He learned not to drink in particular and he gained experience more generally.
Before taking up with Dan Cody, Gatsby had lived a relatively limited life, geographically speaking. This was also true in terms of Gatsby's means.
Boldness and certitude were two of the intangible traits that Gatsby takes away from his time with Cody and which he uses for his gain forever afterward. Gatsby's time with Cody gave him the distance from he former life that he needed to complete a course of change and maturity into a new type of person. The limits of old were stripped away and replaced by what we might call pure potential.
I think the issue is not how long Gatsby stays with Dan, but what he learns from Dan. Remember that Gatsby's head is filled with ineffable gaudiness and imaginings. In this period he learns how to construct the personality he needs to fulfill his dreams. He learns what is attractive about himself; hence he realises that he can manipulate others with his smile. He learns his social value, he experiences women and feels contempt for them. He also learns the bawdy, downside of life which holds little in terms of moral value. In short, he learns how to exploit his own talents to build the life of his dreams which is part of the American Dream. Wealth was attractive to him and would make him more acceptable to the aristocractic class which had heretofore been unaccessible to him.