Experience points are the game's way of tracking your progress through the levels. You gain experince in two ways: Killing opponents, or completing quests or missions.
Oponents include Mobs in any area, and opposing players in PVP/Guild Battles. When an opponent is killed, all living party members get XP for the kill. This is on a sliding scale: If the oponent is greater than your level, you get more, if lesser you get less. The formula is (100 + 16*((Opponent Level)-(Your Level)) + 4 * ((Opponent Level)-(Your Level))/Abs((Opponent Level)-(Your Level)))/(# of players in the party, including henchmen) More human readable is the simple idea that the base xp is 100, if the opponent is not your level there is a +/- 4 bonus if it is higher/lower, and then another +/-16 for each level above/below your opponent you are. This base xp is then divided by the number of other people helping you. Note that everyone's XP is calculated individually: A level 14 character and a level 18 character adventuring together will recieve 68 and 32 xp, respectively. Also, characters that are dead are not counted in the party total, and to not recieve XP.
Missions and Quests give fixed XP amounts, depending on their dificulty. All missions give 1000 XP for the completion of the primary mission and another 1000 XP for completion of the Bonus. Quest rewards vary, early ones give as little as 100 (the first mission), but up to 4000 for the harder ones.
Once you have reached level 20, experience no longer goes into leveling, but into Skill Points.