In a more structured game like 4e, whatever the math requires, unless you do milestone-based levelling, in which case, see below. I find 4e's system is pretty good about this one, relatively well-calibrated. Difficult fights feel rewarding, easy fights may still be worthwhile, and you get rewards for overcoming, not just for defeating, so if you circumvent an encounter purely through skill, cleverness, diplomacy and compromise, or obviating the need for it, it still counts. (E.g., you skip past the guards outside the base, then assassinate the leader in a brisk fight. Leaderless, the goons outside scatter. You overcame them, without fighting them, so you still get all that sweet XP.)
Dungeon World, which is what I actually run, can be slow or fast--but I truly adore how it naturally flattens the levelling curve despite having fundamentally linear XP. Each level gained requires current level+7 XP. You get XP in four ways, generally speaking: resolving bonds (story connections you have to other players), failing on rolls (rolling 6- on 2d6+MOD), fulfilling your Alignment move (a particular category of actions you need to fulfill), or having accomplished any of three things (can get more than one) from the End of Session move (Learn something new and important about the world, Overcome a notable monster or enemy, or Loot a memorable treasure.) So, in general, it's pretty rare for a character to get more than like 7-8 XP in a single session: 3 from End of Session, 1 from Alignment, 1 from resolving a Bond, 2-3 from failed rolls. But the thing is, this scale changes over time. You fail more rolls early on, because you have lower stats. As you get better, you learn how to mitigate your risks more and how to focus on your areas of expertise, where you become more skilled. This directly means that, even though earning level 9 only requires about twice as much XP as earning level 2 did (8 vs 15), earning level 9 will almost certainly take MUCH longer! On top of that, when you're a fresh green adventurer, you're constantly learning new and important things, overcoming notable opponents, and looting memorable treasure, but as you get to high level, these things naturally become less frequent--you know more, so learning something new or important is less common; you are stronger, so fewer opponents are notable, and you already have a lot of swag, so a new treasure has to really stand out to be "memorable." The level-up XP curve can be linear, because the XP input curve is sub-linear.
Milestone levelling is very different, because it's a matter of managing story expectations rather than mechanical ones. In general, you'll want to make milestone levels come after some kind of at least moderately cathartic or thrilling victory, or in response to a major setback (the whole "conviction to do better" sort of thing). This means each adventure is a prime opportunity, but if the overall mood is more just overall pleasure at success or frustration at failure, it may be better to hold off for another adventure or two, rather than going straight away. 13A is in some senses even better than most other systems in this regard, because it has partial "Incremental Advancements," which allow players to get the feeling of still progressing even as you spool out the actual levels themselves. Doling out incremental advances for every small victory and then a full proper Level for each large victory feels pretty good as a player.