Google Maps is your friend when it comes to public transport in the Bay Area.
Just plug in your start and end, and it'll give you multiple options.
Specifically for your route, it will depend a little on the exact time of day, but will start with catching the (free when riding from the airport!) VTA 60 bus from the Airport to Santa Clara Caltrain Station (be careful to get the one going in the right direction, as they stop in exactly the same spot - you do NOT want the one going to the Metro station!)
From there, you can either catch VTA bus 522 ("Rapid") or 22 (all stops) towards Palo Alto that will take you pretty much all the way to Stanford - although you'll still need to walk a short distance depending on where within Stanford you're headed. Alternatively, and probably faster although a little more expensive, you can catch Caltrain to Palo Alto and then catch one of the free shuttles to Stanford, however these do NOT run on weekends.
If you do catch 522/22, the stop for these is on El Camino Real, not within the Caltrain station itself. Basically you want to walk away from the train tracks until you come to the next road. There is a stop for 522/22 within the Caltrain station loop, but this is for buses going in the other direction.