Most insects can fly as long as they are in air that's about fifty degrees Fahrenheit, or warmer.
If the air temperature at ground level is about seventy degrees, insects have about thirty-six hundred feet before they hit the ceiling and it's too cold. On ninety-degree days, that border is at about six thousand feet.
Even if you're at the top of a high rise building, there's no escaping those pesky flies. In fact, insects will seek out their ideal temperature for flying.
If they reach a height where it's too cold for them to fly, they simply fold their wings in and drop until they reach a more comfortable cruising altitude.
The Hitchhiker Insect
Here's another interesting tidbit: insects that migrate long distances hitch rides on the fast winds that move in front of storm fronts and then glide along, which ends up being more energy efficient than flapping their wings.
Air moves fastest at about two and half times the height of the largest obstruction around. So, if we're on a thousand-foot skyscraper, the fastest air is moving about us at about twenty-five hundred feet.