After the party leaves the dungeon safely, all surviving player characters should divide the treasure and be awarded their experience points. Division of treasure is the players' responsibility. Awarding experience points is the Dungeon Master's responsibility. Ideally, treasure should be divided equally among surviving player characters, with retainers* usually receiving a share (minus any advance payment already given them). Players may decide to only give magical items to character classes that could use them. For example, a fighter should take a magical sword as part of his or her share in preference to a scroll. Non-magical treasure is usually divided first, since it is easier to divide equally. It is seldom possible to divide magic items equally. A suggested solution to division of magic items is to have each character roll percentile dice and let the highest score have first pick, second highest score second pick, and so on until there are no more magical items. Retainers may, or may not, be given an equal chance for a magic item. If they are excluded, a DM should note the fact and take it into account when it next comes time to test the retainers' loyalty. For example, a party consisting of a fighter, a magic-user, and a retainer (all first level) returns safely to the Keep. Their recovered treasure equals 520 gold pieces, 1000 silver pieces, a necklace worth 400 gold pieces, a sword +I and a ring of water walking. The total value of all non-magical treasure is 1020 gold pieces. Without selling the necklace, it would be impossible for the party to split the treasure equally. The two player characters compromise by giving the necklace to their retainer, to insure his loyalty with a greater share of treasure. They each take only 310 gold pieces, but the magic-user keeps the ring and the fighter keeps the sword.
Experience points are awarded by the DM to player characters on the basis of *actions taken out of combat that require a skill check* and monsters killed or overcome in combat. *Experience points for actions taken out of combat are equal to the skill check DC, if the skill test was successful multiply the DC by 10. example: a rogue a makes a DC 12 investigation check and fails earning 12 Experience Points. then a little later the bard makes a DC 15 persuasion check to negotiate a lower price for an item in the store and succeeds, earning (DC 15 x 10 for succceeding) 150 experience points.* Experience points for monsters overcome or killed is calculated by using the Monster's Stat-block. Note: monsters that are scared off or routed in combat count the same as if they are killed. In an encounter with multiple monsters add up all the monster's experience points and divide that number by the number of combatants who actively participated in the combat either by attacking the monsters or by helping their party members.
When enough experience points are accumulated, a player character rises to the next higher level, and gains the benefits of that level - See leveling up in the D&D Player's Handbook