I'm curious as to how long postdoc positions in math usually last for. I'm far away from thinking much about this myself but all my grad student friends seem to be telling me they only last a year or two. Now I know people don't want a postdoctoral position that's too long, but I'm getting the sense that postdocs in math are both less common and generally shorter than post docs in other areas. I'm wondering if this is true or if I'm just getting the wrong idea as an undergrad from a relatively small pool of graduate students. Primarily I'm just curious as to how long these positions usually last in mathematics.
This varies considerably from country to country. In the US, the "gold standard" is typically a 3 year position (just a quick look at MathJobs reveals ones at Baylor, Dartmouth, Northeastern, and that was just on the first page of listings). Note that some will say that they are shorter with a possibility of extension to 3 years; the extension is generally just a formality. There are even occasionally 4 year positions. There are also a mix of shorter positions: one semester or one year appointments at institutes like MSRI or IAS are usually intended to complement specific programs, and generally taken as a supplement to a longer term position. Sometimes there are shorter grant funded positions, though in most cases I know in the US, the department will be able to step in to extend the appointment to 3 years. "Postdoc" is also a kind of porous category; sometimes departments will hire shorter term positions when they just need someone to teach a few classes which fit somewhere on the continuum of postdoc to adjunct positions.
In the rest of the world, positions this long are much less common, due to some mix of cultural and economic factors, but certainly not unknown. Generally positions outside the US are funded by grants, and it is hard to get enough funding to support a postdoc for 3 years (in most countries).
While it is hard to say anything completely precise, your friends would generally be correct if they were speaking about postdocs in Europe (at least in my branch of pure math).
I have looked through a lot of math postdoc positions while looking for one myself, and at least in Europe they rarely last more than 2 years.
This is not to say that there are no 3-year postdocs, but they are far between, at least in pure math in Europe.