While traditional, level-based MMOs don't usually allow you to earn XP while logged off, some skill-based systems do. EVE Online, for example, has a passive skill-leveling system, where players choose a queue of various skills that level up in real-time whether they are logged in or out. On the other hand, Darkfall uses an active skill-leveling system. The more you slash with a one-handed sword, the better your skill with one-handed swords becomes. If you switch to a two-handed hammer, you won't be as good until you start using it more.
Syncaine has started an interesting discussion on his blog about the pros and cons of passive versus active skill gain in MMOs. While the original article favours one over the other, the comments really show both sides of the argument.