These structures are generally sidewalk sheds, as they usually serve to protect the sidewalk during construction, demolition, and certain types of renovations as required by the building code (such as those involving the exterior facade or hoisting equipment). They're intended to protect people on the sidewalk without causing the disruption and harm to businesses that would come from closing the area to pedestrians. There are thousands of them in the city at any given time, and some are up for years (sometimes many years).
They are not required simply because of proximity to a tall building. Short buildings may have sidewalk sheds if they are under construction, while tall buildings not undergoing renovations will not have sidewalk sheds.
The Empire State Building is working on a large renovation project. Since that project includes a new entrance and other exterior changes, where any falling tools or material could injure those below, I presume a sidewalk shed was required.