Normally supplemented (for different reasons, which we'll cover in a moment) in dosages up to 1000mg per day.
One use is to aid restful sleep. Famously, professional bodybuilders of the 70's and 80's performing double-splits (training twice in one day) would take 1000mg of Magnesium after a morning session to help them sleep deeply, in order to aid their recovery. My (GP) favourite bodybuilder of all time - Frank Zane - was an advocate of this. Many sports supplements manufacturers today have a product amongst their range containing a large dosage of Magnesium with instruction of supplementing before bedtime, normally coupled with Zinc and sometimes Boron. The calming effect of Magnesium supplementation means that it's often used to help with anxiety and insomnia, which can be caused through Magnesium deficiency.
Another common supplemental use of Magnesium, although more popular with endurance athletes, is to avoid muscle cramps. Again, Magnesium deficiency (most likely due to excessive sweating in an endurance endeavor) being a likely cause of muscle cramps and muscle twitches. Other electrolytes - Calcium, Potassium and Sodium - are also important to replenish, hence the popularity of isotonic drinks for endurance events, but Magnesium can often be depleted first, due to a lesser amount being consumed within many diets.
The late Dr. Mildred Seelig (a renowned researcher of Magnesium - you should be able to find her book on Amazon!) believed deficiency was wide spread amongst Western countries. There's many food sources (see some below) that provide good levels of Magnesium though. The reason for me typing this page tonight is that a running friend had mentioned yesterday that they'd started supplementing Magnesium and asked about food sources, their diet already contained almost all the sources I've listed below. Two other more unlikely supplemental uses is firstly for a hangover, as alcohol depletes Magnesium levels. Try an isotonic drink after a night out - you'll feel far better! Secondly, to ease muscle cramps and sugar cravings. Again, cramps and low sugar levels being an indication of low levels of Magnesium.
Magnesium's functions also include formation of bone and teeth, where, along with calcium and phosphorus, Magnesium provides both structure and strength.
Food sources include: Wholegrain (bread & cereal), Dairy Products, Fish and other Seafood, Meat, Nuts.