Neighborhood are often managed by a Home Owners Association (HOA). So, not codified laws, just a contract/rules you sign when you buy/rent in that area.
Outside an HOA (typically older or rural homes), you can often do what you want.
Inside an HOA (most suburban development since the 70s), you get rules that span from reasonable to crazy, but as a resident you know the rules up front.
Towns can have some of these rules too, but the detailed “don’t do X” that make the news are almost always HOA things.
In the primary example in the article, it sounds like there isn’t a rule, just neighbors complaining. The women correctly told them to piss off.