Three Wishes for Opie - S5-E14
Revealing mistake: Barney, convinced he can foretell the future, is in the darkened jailhouse, seated between Goober and Floyd at a table. Goober strikes a match and lights a lamp which is directly in front of Barney. The immediate illumination obviously comes from a studio light because the men's shadows on the wall are to the far left of the men, instead of directly behind them.
Answer: Those "boxes" are valences that used to be very common, before air conditioning. They allow for windows to be open during rain storms. They permit air circulation, without letting the rain in.