Depends on the city and how contested it was. Rahm Emanuel's race for Mayor of Chicago lasted about four months, iirc. But that's a non-partisan race (i.e., no primaries). The Philadelphia Mayoral race lasted nearly a year from when campaigning started to when the general election was held. But I'm sure even partisan races in smaller cities don't need so long of a campaign season.
I don't know about Boston, but the city of Phoenix just had a hotly contested race last year (previous mayor was term limited) and it took about 8 months.
Yeah, it varies greatly depending on regional laws regarding municipal elections. Here, they're about a month long.
The mayoral election where I am is in October, four candidates have already declared and one has dropped out. The incumbent hasn't declared yet, and it looks like he might finally be on the way out the door. (Yay!)
Well, that's probably partly why it's a non-partisan election. There's no point having a primary because Delay would win the Democratic primary (if opposed) and then win the general election.