APEX, N.C.—This Raleigh, N.C., suburb was declared the best place to live in America by a national magazine in 2015, around the time Lindsay and Terry Mahaffey were drawn by its schools, affordable housing and quaint downtown.

The couple found a sprawling five-bedroom house next to a horse farm for $782,000, half the cost they would have paid in the Seattle suburb they left behind.

Many other families had the same idea. Apex, nicknamed the Millennial Mayberry, is the fastest-growing suburb in the U.S., according to Realtor.com, and the town is struggling to keep pace with all the newcomers.

When Mr. and Mrs. Mahaffey took their eldest daughter for the first day of kindergarten, school officials told them they didn’t have a seat. Too many kids, they said. On weekends, the family thinks twice about going downtown—not enough parking. And the horse farm next door was sold for a subdivision.

The couple, like generations before them, soon took an active role in trying to shape their new hometown.