The Borderlands 2 leveling and experience system is somewhat like you would expect, but there are some twists you might not expect. Generally you are rewarded with experience by killing enemies and completing quests.
Borderlands 2 Experience System
As I said before you gain experience through killing enemies and completing quests. You gain more experience the higher the level of the enemies you kill. More difficult quests award you with more experience.
Enemies level with you, so even an earlier area can have higher level enemies spawn if you backtrack.
Borderlands 2 Leveling Up and Skills System
When you level up you can spend a skill point in your skill tree, at least if you are level 5 or above. Before that you don’t get any new skill points. Most upgrades have 5 levels to them. To gain access to a higher level skill you need to put at least 5 points in the current skill level. You can do that for any skills you have unlocked. So you can spend 2 on one skill and 3 on the other and unlock the next level.
You have to keep in mind that you can’t get every skill. Spend your points wisely and compare the different skills. In the early game focus on health and shield upgrades as survivability is important in Borderlands 2.