The route from Montauk to Rockville Centre to Boston can be seen here. Most of the story takes place in Rockville Centre (New York), a town on Long Island about five miles east of Queens (the easternmost borough of New York City). It's just a few miles east of the easternmost road leaving Long Island. Joel's apartment is about 0.4 mile from the LIRR (Long Island Railroad) Rockville Centre station. Montauk (New York) is about 100 miles east of Rockville Centre, at the eastern tip of Long Island. Montauk Point State Park is at the very tip, and the town of Montauk is adjacent. The train ride would be about two and a half to three hours. The Charles River is in Boston (Massachusetts). Boston is about 220 miles from Rockville Centre, about a 4½-hour drive, perhaps 3½ hours late at night. (It's all on freeways, but the traffic is heavy.) Thus a trip to the Charles River (in Boston) from Rockville Centre is a major drive, about 7 hours round trip, minimum. From Rockville Center, the bearings to Boston and Montauk are only about 30 degrees apart. However, because the only way to cross Long Island Sound east of Rockville Centre is by ferry, Boston and Montauk might as well be in opposite directions from Rockville Centre. The location of the Lacuna office is in lower Manhattan. However, this isn't really significant in the movie. Technically, it's a bit less convenient to reach from Rockville Centre than you'd guess from the movie. It's portrayed as something local, and that's the significant part.
Some people have noted the apparently rural character of the "frozen Charles" scenes and the apparent incongruity with the location in central Boston. Nonetheless, there's little ambiguity about the location, because the Charles is a short river, with the source only 26 air miles from the mouth. See here for more information. There are lots of parks along the Charles River even in the urban area. However, the scenes could also imply the outer areas of the Charles, which are closer to Interstates 95 and 495 nearer to the source. The distant headlights in the background would imply this. Also in these areas, the ice would be thicker given the shallower depth; within the immediate Boston area, the ice is generally too thin to safely walk across.