After he meets Daisy once again in Nick's cottage, Gatsby and Nick are left alone for a few minutes. In their conversation, Gatsby tells Nick he earned the money to buy his house in only three years. This fits the timeline of Gatsby's history as it unfolds. He had met Daisy in Louisville approximately five years earlier, gone to war, and then returned to New York where he met Meyer Wolfsheim and began his illegal, but quite lucrative, career. The chronology of these events indicates that Gatsby is telling the truth when he says he became quite wealthy in only three years.
In The Great Gatsby, it took Gatsby three years to accrue the money necessary to buy the house. Gatsby goes about earning this money in ways that are considered less than savory by the upper crust of New York. Although his business dealings are never explicitly explained, we do know that Gatsby was connected with Meyer Wolfsheim. He likely engaged in illegal activities with this shady man, including the sale of liquor during the Prohibition. Tom Buchanan discusses this, claiming:
"I found out what your 'drug-stores' were." He turned to us and spoke rapidly. "He and this Wolfsheim bought up a lot of side-street drug-stores here and in Chicago and sold grain alcohol over the counter. That's one of his little stunts. I picked him for a bootlegger the first time I saw him, and I wasn't far wrong.
Unfortunately for Gatsby, all the money in the world can't buy back Daisy's affections after Tom has exposed him as a criminal.