- When the treasure is found. Open up the treasure chest and bang! -- you get the x.p. It was hard to find, and you fought or outwitted the guardian or traps that protected it, so now you get the benefit.
- When the treasure is taken out of the dungeon. The rationale behind this is that part of the difficulty with treasure is hauling it all out, so you can't really say the equation has been balanced until that happens.
- When you spend the treasure in a character-appropriate way. This seems to be a new-ish idea, coming out of the OSR in the last couple of years. This runs into the "Brewster's Millions" problem, where the players have to find ways to spend them, rather than, say, hiding it in their own vault or investing it somehow.
The first one has a hidden side-effect: since you don't actually need to remove the treasure, there's less incentive to rationalize why, in a quest to stop the ravening horde from descending on the city, you need to stop and pick up every coin you see. I.e., less incentive to play "murder hobos", even while retaining the old-school formula for x.p.
This occurred to me while playing the latest Tomb Raider videogame. Lara Croft is on some expedition on a Japanese island, something something Sun Goddess, something something Chosen One--the story isn't particularly new, and video game dialogue and acting has yet to thrill me. But as she zips around the island, fighting off cultists and drawing nearer to the certain Final Showdown, she can raid various "tombs" (a term used as loosely as tabletop gamers use "dungeon") to find the various artifacts they contain. Although she does, in fact, take them (and gets x.p. for them, and points for "cargo"), they have little effect on the game after that point. Certainly not in terms of encumbrance. She may as well never have touched them.
Of course, x.p. here has less effect than it does in a tabletop game, but the idea struck me that this could be a way to have the best of both worlds, by having character-driven labors and story-derived challenges, and still being able to account for x.p. in the tidy, old-fashioned way.