It depends on the mechanism it uses to stick to the ceiling (and on the ceiling material).
Using the multiple-tendril mechanism of gecko feet, you can bear a weight of about ten Newton per square centimeter (a mass of one kg in Earth gravity; six on the Moon, and so on). This means that theoretically, and if the ceiling plaster doesn't give way making it fall down, a human-sized insect with webbed hands and feet could easily walk upside down in Earth gravity. If it had more than four legs, all the better.
Using simple adhesion ("stickyness") you probably can't go heavier than about five hundred milliNewtons per square centimeter, but with reduced gravity and feet enough, human size is again doable. Even more so if the insect is less dense than a human being.
Chemical bonding allows even higher weights; the limit is the tensile strength of the ceiling material, provided that it is amenable to that specific kind of bonding (you woudn't be able to walk on a smooth PTFE ceiling). But you'd leave large tracks, you'd need to go comparatively slowly and the need to secrete the appropriate "superglue" would exact a very heavy biological toll. Some marine gasteropods do something similar though, so an alien insect also might.
An intermediate solution would be to use heat glue - you'd almost surely need an omeothermic creature for that, which Earth insects aren't. The insect would be capable of "heating" its appendages, thereby making the organic "glue" secreted by its extremities semiliquid; once the foot has taken hold, it would cool, and the glue would set guaranteeing a good grip. In Earth conditions this would only allow a really slow gait (a sort of insectile sloth, maybe). The foot would naturally gather dust and other debris, so the creature would need to periodically fling the dirty glue away.
Or perhaps - depending on the nature of the "ceiling" - an insect might evolve the equivalent of harpoons or drills to anchor itself. The peacock mantis shrimp is capable of cracking small rocks and "drilling" cavities in shells and burrows in concrete and live rock by bashing its appendages against it; a similar method could allow to quickly drill small cavities which, filled by an expanding palp, would allow "walking" on vertical walls or ceilings to a creature of almost any size ( again, provided the walls or ceiling did not undergo structural failure).