A building permit is not required for fences up to 7 feet in height (nominal). A building permit must be obtained for any fence over 7 feet in height. Also, according to MGL c. 49 Section 21, fences over 6 feet in height could be considered to be a spite fence. Therefore, for any fence over 6 feet in height, it is strongly recommended that you obtain approval of the abutter.
It is also recommended that you talk with your neighbor prior to installing any fence, regardless of height.
If your fence is on the corner of two streets, the City of Beverly Zoning Ordinance 300-16 states, in part:
On a corner lot … nothing else shall be erected, placed, planted, or allowed to grow in such a manner as to obstruct vision at intersections between a height of three feet and eight feet above the street grades in the triangular area bounded by the street lines of such corner lot and a line joining points along said street lines of 25 feet from their intersection.
What this means is that for fences on a corner lot, the height may be limited to no more than 3 feet for a distance of 25 feet from the intersection of the streets, along each street line. This is to prevent obstructions to site distance for vehicles.