The wikipedia article of aqua regia has beautifully mentioned the mechanism of gold dissolving in aqua regia:
Aqua regia dissolves gold, though neither constituent acid will do so alone, because, in combination, each acid performs a different task. Nitric acid is a powerful oxidizer, which will actually dissolve a virtually undetectable amount of gold, forming gold ions ($\ce{Au^3+}$). The hydrochloric acid provides a ready supply of chloride ions ($\ce{Cl−}$), which react with the gold ions to produce tetrachloroaurate(III) anions, also in solution. The reaction with hydrochloric acid is an equilibrium reaction which favors formation of chloroaurate anions ($\ce{AuCl4−}$). This results in a removal of gold ions from solution and allows further oxidation of gold to take place. The gold dissolves to become chloroauric acid. In addition, gold may be dissolved by the free chlorine present in aqua regia. Appropriate equations are:
$$\ce{Au + 3HNO3 + 4HCl <=>> AuCl4- + 3NO2 + H3O+ + 2H2O}$$
$$\ce{Au + HNO3 + 4HCl <=>> AuCl4- + NO + H3O+ + H2O}$$
If the aqua regia solution only contains gold, solid tetrachloroauric
acid may be prepared by boiling off excess aqua regia, and removing
residual nitric acid by repeatedly heating with hydrochloric acid.