There are subtle clues inside the films to establish their individual timeframes, but no concrete evidence that they are connected in any way beyond the actor Clint Eastwood, and any connecting mannerisms he places in the character. Sergio Leone himself said that it was merely a packaging ploy by the American distribution company to link the films. The best we can do is establish their times by visual clues inside the films themselves.
The Good, The Bad, and The Ugly has grave markers in the military cemetary shown dated 1862 and 1864, while the war is still active, so the events occur in 1864 - 1866.
Fistful of Dollars and For a Few Dollars More has Clint Eastwood's revolver as the "Single Action Army revolver" introduced 1872. Fistful of Dollars has a gravestone dated 1873, and For a Few Dollars More shows a newspaper archive dated 1873. So these films' timeframe is 1873 or later.
So the films show GBU to be at least 7-8 years before the established timeframe of the other two. Plenty of time to lose, spend, or bury those bags of gold, but, since GBU was filmed later, and not intended by Leone to be connected, that's mere conjecture.
Much of this data is attributed to a variety of websites devoted to details of the films and the director, Sergio Leone.