How high can a housefly fly and which insects can fly the highest?

How high an insect can fly depends on air temperature.

Generally speaking, most insects can fly as long as they stay in air above 50 degrees Fahrenheit. If the air temperature at ground level is 90 degrees, the 50-degree border is around 6,000 feet; if ground temperatures are in the 70s, the ceiling is around 3,600 feet.

Insects have the ability to adjust their altitude, looking for the temperature they want to fly in. When it gets too cold, they tend to fold their wings and drop.

A number of insect species are adapted for long-range migration. Some of these species have large bodies and wings, but some that have very small ones, like leafhoppers, also migrate long distances.

All seem to sense approaching storm fronts and ride the fast-moving winds ahead of them. They use energy to get up into the fast-moving air, then glide as the storm front moves them along.
The fast-moving air begins at the planetary boundary layer, about two and a half times the height of the largest surface obstruction around. So if there are 80-foot trees, it would begin at roughly 200 feet.