The short answer
There is no single number that fits every unit. The safest guide is the clearance listed in your model’s installation manual, because manufacturers set minimums for their own airflow designs. As a general rule, keep the area directly above and in front of an indoor wall unit clear of shelves, curtains and furniture. Leave the outdoor side open as well.
Above and in front of an indoor unit
Most wall units draw room air in through a grille at the front and push cooled air back out through the louvers. Anything placed right against the front grille, or sitting directly above the unit, can cut that flow. Shelves, curtain rods and wall hangings are the usual problems overhead. A sofa or bed pushed up to the front can block the intake. Leave enough room at the ceiling for the top vents and for the louvers to swing freely.
Clearance on the outdoor side
The outdoor part of a through-the-wall unit needs open air to release heat. Keep stacked items, fences, shrubs and decking clear of the outside grille. Many guides suggest keeping several feet of open space around outdoor units, but the manual is the reliable source for your model.
Clear space also makes it easier to clean your air conditioner condenser unit, since dirt and debris build up on the outdoor coil and fins.
Why blocked airflow causes trouble
Restricted airflow makes a unit cool less and work harder. On the indoor side, low airflow over the coil can make it freeze, and a frozen coil cuts cooling further. A dirty filter adds to the problem. If a unit has stopped cooling well, check the airflow path before assuming a bigger fault.
Leave room for the filter and service
Clearance also matters when someone needs to reach the filter or the internal parts. Plan the spot so the filter slides out without moving furniture, and so a technician can work on the unit without climbing over things. The placement mistakes covered in where not to install an air conditioner tend to cause the same clearance problems, so it is worth checking that list too.
Check the manual first
The installation manual lists the minimum clearances for your model, and those figures override general advice. Local building codes can add requirements, especially for through-the-wall installs. A licensed installer will check these when they choose the mounting spot. The height and the clearance go together, so the best height for wall air conditioner placement depends on the same airflow rules.