It depends on what type of leveling system you need, are you leveling your character as a whole or does each skill have an independent leveling system, are you gaining xp on enemy kill, enemy hit or level complete.
But what it comes down to is the usage of variables and/or arrays/dictionaries. You need to write, mostly using arrays or dictionaries, the xp number for every way you want to be able to gain xp, 10xp for killing enemy A, 50xp for killing boss B, 30xp for solving puzzle C etc.
After that you need to, using events, trigger the specific xp gain and add that number to the xp counter, which can also be recorded in an array, dictionary or a variable.
After the xp counter hits a specific number, your character or skill gains a level.
EDIT: I should type faster, or use easier examples.