Gaffney carried the ball 20 times, scoring on runs of 16 and 2 yards.
Kevin Hogan completed 17-of-27 passes for 207 yards with two TDs and no interceptions for the Cardinal (1-0).
Ty Montgomery led Stanford's receiving corps with four receptions for 81 yards with a score, and Devon Cajuste made three grabs for 62 yards and a TD in the victory.
David Fales' 29-of-43 passing efficiency for 216 yards, a touchdown and an interception paced San Jose State (1-1).
Wisconsin business offering 'therapeutic cuddling' forced to close
Exploding whale video goes viral on Internet