In the individual event, An crossed the line first with a time of 41.312 seconds at the Iceberg Skating Palace, with China's Wu Dajing coming second and Charle Cournoyer of Canada third.
He then helped set a new Olympic record time of six minutes and 42.100 seconds alongside his Russia team-mates Semen Elistratov, Vladimir Grigorev and Ruslan Zakharov as they secured victory in the relay event, while the United States and China took silver and bronze respectively.
An, who at previous Games has competed for South Korea, has three golds in total from Sochi as well as a bronze, and is tied with American Apolo Anton Ohno in terms of having won the highest number of Olympic short track medals - eight.
An said: "This has been the best experience of my sporting career and I will never forget Sochi.
"Before the competitions started, I just wanted to concentrate on doing my best and showing what I could be on the Olympic stage.
"I'm happy to have tied the record for medals in short track - and I'm even happier to have done it as a Russian."
Between the two mens' finals, South Korea's Park Seung-hi claimed gold in the women's 1000m final, with her compatriot Shim Suk-hee placing third and Fan Kexin of China finishing second.