Continuity mistake: At the "Hen Party", Jeff Pruitt says hello to Thelma Lou and she states she is going to get coffee, then goes to the kitchen. However, when Jeff walks across the room and looks back, Thelma Lou is back in the same area. She never walked back from the kitchen.
Continuity mistake: In the initial episode, and Runaway Kid in season 1, Barney is a cousin of Andy's. In subsequent episodes, they are unrelated.
Continuity mistake: Scenes shot at Andy's porch have significant differences depending on the filming location, as there are two sets of Andy's porch. One is just the facade of the house in the 'town of Mayberry' in the studio's 40 Acre backlot; and the second is located in the studio's soundstage. Note in some shots the door's sidelights have vertical muntin bars, the screen door has a white handle, whereas in other shots the sidelights' muntin bars are gone and the screen door handle is black (screen door's gone season 5). Also, note the significant difference in the width of the wall between the parlor windows and the door, the height of the parlor windows from the floor, etc.
Continuity mistake: The fuel pumps at Wally's gas station (regular and super) switch sides between numerous episodes.
Answer: As noted in the previous answers, in real life, things like this provided wind and/or rain deflection, and also maintained a bit of privacy when blinds were raised somewhat. The interior courthouse set was located in the studio, so the "outside" Main Street didn't exist. I believe these things were added to the courthouse windows for practicality, to avoid some crew movement being visible on the opposite side of those windows. These are not "window boxes" to hold anything, as they're actually bottomless; we can see the Venetian blind's long pull cords under them. They're made of plywood and simple to build, so the "material and labor" was inexpensive. Similar variations made of different materials are in other movies/shows. In 1957's "12 Angry Men," textured chicken wire glass panels are in the jury room windows, and in "Jesse Stone: Night Passage" another type is in Jesse's office windows.
Super Grover ★