Anderson, 23, joined Sage Kotsenburg as the winner of slopestyle gold after her countryman had produced an upset victory in the men's version of the competition on Saturday.
There was no surprise on Sunday since Anderson owns four slopestyle gold medals from the X-Games.
Each of the 12 slopestyle finalists had two chances to attack a course dotted with rails and jumps, on which various acrobatic maneuvers are performed.
The best of the two scores received is the one that counts in the final result and after the first run Anderson was in second place with a score of 80.75.
Scores were better in the second run as the competitors went all out to claim an Olympic medal and Anderson would have missed out on a medal had she not come through with a big performance.
The judges rewarded her second run with a score of 95.25, leaving Finland's Enni Rukajarvi (92.50) with the silver medal. Jenny Jones of Britain was third with a score of 87.25.
Spencer O'Brien of Canada defeated Anderson at the most recent world championships, but O'Brien turned in two poor runs in the finals and wound up 12th.