The lagering is to drop polyphenols (like tannins) out of the beer so you get a smoother, crisper finish to the beer. A lengthy lagering period isn't really necessary- but it gives a better result for many beers.
A rule of thumb (from Noonan) is to lager one week for every 8-10 points of OG. So, for a 1.040 lager, 4-5 weeks would be about right. For a 1.060, 6-8 weeks would be about right.
The closer you lager to freezing, the longer it takes to lager. But I really love the results of "colder, longer"- that is, at 34 degrees for the lower end of the lagering time, as I think it provides a better crisper end product. You can certainly lager at a higher temperature, for a shorter period of time but I don't think it's the same.