For Mages, Nargor (sleep) and Geigor (confusion) are the spells of choice. Since you only have a few spells to start, you want to use them wisely. Since every time you destroy a monster (kill, sleep, confuse, etc) you get a chance to make level, what you want to do is maximize the number you get with each spell you cast.
Mages should always fight from the back. Have some good fighters that can handle most encounters. Wait until you get encounters with lots of monsters. If you have a single group of, say, 10 or more, check their level. If they are level 1 or 2 use your Mage's Nargor (sleep) spell. If you get multiple groups of monsters (except undead), then use your Mage's Geigor (confusion) spell. The idea is to maximize the number of monsters you kill with each spell.
Also choose races which level more quickly. Kobold Mages make levels like crazy.
If you are trying to level Priests, you CAN do it using only spells, but it is tough. For low levels, the only offensive spell that is particularly useful is the hold person . You can get up to 4 monsters with this spell, but generally you will only have 1 or 2 spells per trip. Priests are also good when facing undead, as they can use their innate dispel ability as well as their level 1 dispel spell.
However, Priests can wear chain mail and use a shield which makes them decent fighters. You can put them up at the front and they can usually hold their own. At the higher levels there are some nice spells (e.g. Rods) which can take out large groups of fairly high level monsters, and you can level them without fighting as much.