Depends on what you require. If urban living is what you want, you can probably find something close to Harvard, provided you are a Rockefeller or a Kennedy. The suggestions here seem right on the money. No pun intended.
Keep in mind, though, that Boston has an extremely convenient transit system that links the suburbs by rail. Yeah, it means taking a train, but the northbound trains run through some very nice and cheaper areas. And they run until midnight.
Swampscott and Salem aren't far. Maybe 20 minutes from Boston. You connect at North Station and from there you can get to the Red Line to Harvard very easily. The subway system is color-coded and among the easiest in the world to navigate.
When I was at Harvard, I lived on campus. What I know about Cambridge and Boston, even now, is that it is VERY expensive, unless you share with roommates. I still visit the area, especially the North Shore where my mom lives.
Somerville (pronounced "summerville") is next to Cambridge and is a little more affordable.
If you have a car, parking in and around Cambridge, especially Harvard Square, is a nightmare. And the frustration doubles in winter because they don't get to the sidestreets for days. If you want to have a car, then the burbs would be better because you can take the train and get where you need to go without any parking hassles. Parking in Boston is also problematic and expensive.