Each time you catch a Pokemon, you’ll get a bunch of XP. The amount you receive actually depends on a couple of different criteria, though. First off is whether or not the Pokemon is new to your Pokedex. If you’ve caught the Pokemon before, you can expect to get a base 100 XP for your catch. However, if this is a new species, you’ll be granted a smooth 500 XP on top of that.
Therefore you should never be walking past a Pokemon, even if you’ve caught it before. Not only can you transfer any duplicate Pokemon to Professor Willow for some sweet items, but 100 XP is better than nothing. Of course, exploring will help you to get the most out of your Pokemon captures, too. The more varied places you go adventuring, the more chance you have of catching new Pokemon, granting you that sweet 500 XP bonus.