Ah, the mash temperature!
First, the mash is the place where enzymes in the malt convert the starch in the grains into fermentable sugar.
While the mash temperature has to be somewhere between 62 C (the lowest temperature at which the enzymes will do much work) and 68 C (the temperature at which the enzymes will be destroyed), the actual temperature you choose depends on the characteristics you are aiming for in the final beer.
To put it simply, high mash temperatures result in a sweeter beer, low temperatures give a drier beer.
The reason for this is that there are two (main) enzymes at work in the mash; alpha amylase and beta amylase. To grossly oversimplify, alpha amylase produces a less fermentable type of sugar called dextrose, while beta amylase produces maltose, which is highly fermentable. If you have plenty of dextrin, it won't ferment out, and will leave a sweetness in the finished beer.
Alpha amylase works better at high temperatures, hence if the mash temperature is high, you get more dextrins, and a sweeter beer. (Phew!)
The other effect, of course, is that the reaction takes longer at lower temperatures.