The process of unlocking the skins is simple, but time consuming.
To unlock them, you must accumulate 3000 Competitive Points. You earn these by playing in Seasons games and winning them. The kicker, you only get a few points for winning a match. This means that it will take a lot of matches to accumulate the 3000 you need.
Once you have accumulated the necessary 3000 points, you can simply go into the Hero Gallery, pick a character and buy the Golden Gun skin.
Since these skins apply directly to the gun, they will always be present no matter what character skin you equip. This means that even your fanciest of Legendary skins can also have the Golden Gun Skin equipped!