Stafford's tally with less than 6 minutes remaining in the third period broke a 2-2 tie. He then helped out Nathan Gerbe on another Buffalo score 2 minutes later to seal the victory.
Ryan Miller earned the victory with 23 saves.
The Oilers lost for the fourth time in five games despite goals from Taylor Hall, Sam Gagner and Corey Potter.
Nikolai Khabibulin yielded four goals on 33 shots for Edmonton.
Beyonce flaunts bikini body, Blue Ivy in vacation pics
Kate Middleton recycles dress at movie premiere