Cousins Beach, as referenced in "The Summer I Turned Pretty," is popularly believed to be located in Massachusetts near Cape Cod, south of Boston. The distance from Boston to Cousins Island (which relates to the namesake Cousins Beach area) is approximately 118.8 to 121 miles by road, roughly around a 2.5 to 4-hour drive depending on the route and traffic.
In the fictional context of the show, Cousins Beach appears near Marblehead, Massachusetts, which is close to Boston, but the filming locations are actually in Wilmington, North Carolina, so the real-world travel distance to those filming sites would differ.
But sticking to the assumed real Cousins Beach near Boston, the distance is about 120 miles south of Boston.