A creature will exhaust the air in its personal envelope in 2d10 turns. They may survive for 2-20 rounds once they leave the atmosphere, as normal creatures, but this will not allow them to fly any farther than a very close moon. The one consistent thread through each treatment of flying creatures in space is that wildspace travel can only occur with spelljammers. If you believe that, I've got this rainbow bridge I'd like to sell you. And if you order before midnight I'll throw in a video of Heavy Metal absolutely free.
Fantasy flying creatures can fly to other planets.
At least, they can in my world. And now they can in yours. All you need is a little imagination and no respect for the laws of science. First, we should decide one simple ground rule. For Earth-like planets, any flying creature with three or more hit dice or levels.