What are all the sources of XP?
There are several ways to get XP in the game. I've copied this from the Pokemon GO Wiki.
Win a fight with a pokemon at at an opposing team's gym: 150 XP
Fighting a pokemon at an opposing team's gym: 100 XP
Win a fight with a Pokemon at a gym that belongs to your team: 50 XP
Capturing Pokemon (100 XP)
Adding new Pokemon to your Pokedex, whether seen, caught, or evolved (500 XP)
Evolving Pokemon (500 XP)
Going to Pokestops (50 XP)
Hatching an egg (500 XP for new Pokemon or 200XP for existing)
Capturing a Pokemon with a Nice Throw (10 XP bonus) OR
- Capturing a Pokemon with a Great Throw (50 XP bonus) OR
- Capturing a Pokemon with an Excellent Throw (100 XP bonus) OR
- Capturing a Pokemon with an Curve ball (10 XP bonus)
All of these can be doubled by using the Lucky Egg item
Here's an exhaustive list with the exact XP values:
- Catching a pokemon: 100 XP
- Adding a new pokemon to the pokedex: 500 XP
- Evolving a pokemon: 500 XP
- Curve ball: 10 XP
- "Nice" throw: 10 XP
- "Great" throw: 50 XP
- "Excellent" throw: 100 XP
- Visit a Pokestop: 50 XP
- Hatch an egg: 200 XP
- Beating a pokemon at a gym: 150 XP
- Battling a pokemon at a gym: 100 XP
- Beat a pokemon in training at a gym: 50 XP
It's worth noting that using a special egg will double these XP values for the next 30 minutes.