Experience is given after Battles, which can be quests, dueling, or tournaments. 1 xp is given for each full quest, whether it be an hour, 2 hour, or 3 hour quest. Leaving in the middle of a quest without notice means 0xp, but if you leave halfway through with notice, you can still receive .5 xp. Below is the chart describing the xp needed for each level.
-Level-
-XP needed to advance-