It depends on what you mean by an extended period of time, and it depends on the kind of paint and how fast it dries.
In addition to clogging the nozzle, the paint in the cup starts to thicken. Its spray characteristics will change as it thickens. Even if the lid forms a decent seal, there's air in the cup.
Some people will keep using the airbrush as long as the paint is still liquid and the airbrush can push it out. Other people clean out the airbrush as soon as they stop spraying, even if they will be using it again soon. Some people pick a time, like 10-15 minutes and clean it if they expect it to sit longer than that. Emptying the paint back into a proper container keeps it fresher and you'll get more uniform results.
So assuming you're talking about a time short of emptying and cleaning, and longer than a few minutes, what can you do to keep the nozzle from getting clogged? The main thing is sealing it from the air, preferably in contact with some solvent, to keep it from drying out.
If the airbrush didn't come with a nozzle cap, make one out of something like Sugru or Oogoo (homemade Sugru from silicone caulk and starch). It just needs to seal out air and not trap much air under the cap.
You can go an extra step by leaving a small clearance inside the cap and stick a little bit of paper towel in there soaked in an appropriate solvent for the paint (water if acrylic). The cap will hold that in contact with the nozzle and keep the paint from drying.
If you don't want to go through all that, cover the nozzle with a piece of tape that doesn't leave any residue (and leave a folded-over end to make removal easy). Or wrap the nozzle tightly with plastic cling wrap and tape that to keep it from loosening. You can use the wad of wet paper towel trick inside the cling wrap, just make everything a tight fit so there isn't air in the pocket.