If you're talking about a white gas stove like an MSR or optimus stove with a pump bottle, no, don't leave it attached or you'll break things, disassemble it and pack it up sanely.

If you're talking about a stove that uses a butane cartridge that is punches through (like the bluet stoves from europe) forget it, you have to leave it attached.

If you are talking about a canister stove that uses isopropane/butane canisters (MSR pocket rocket, snow peak, primius micron, crux, etc.) Tom gave you one answer, which I'll more or less stick to, however I have a different experience with such stoves.

The top of these canisters have a little valve called a "lindal valve" on them. it has a little ball in it
that the poky centre of the stove pushes down out of the hole to let the gas out. when you unscrew the stove from the canister, the ball pops back up and seals the hole.

I *have* had the lindal valves fail on canisters. usually in colder weather, but I figure it can happen anywhere. So, the answer I will give you is "usually you can unscrew it" . the problem is that if the lindal valve does not reseal, all your fuel can leak out slowly. so I unscrew my cautiously, and then test to see if there is any gas coming out the valve after (be careful using a "spit bubble" in cold weather or you'll get water in there that if it freezes *will* make the valve fail - I've used a dribble
of alcohol to see if it bubbles, or test with your finger over it. my failures would have been felt with
a finger over the hole). if there is gas coming out after, and you don't want to eat cold food the rest of your trip, screw your stove back on fully, tape the valve in the off position while you're transporting it, and don't take the stove off till the canister's done.
_________________________
Any fool can be uncomfortable...
My 3 season gear list
Winter list.
Browse my pictures