Will liquid keep longer if I boil it and then leave the lid on?
If both foodstuff and cooking vessel are heated fully and tightly sealed, you may sterilize them well enough to delay spoilage. It is not safe to rely on this, because it is easy to compromise the seal.  You can't be sure the lid of the pot got hot enough to sterilize it too, and escaping steam will open the lid slightly, allowing outside air in.  Once contaminated, warm broth and meat are a perfect growth medium for bacteria.

The safer approach is opt for fast cooling in an ice water bath with the lid off to allow steam to escape, followed by prompt refrigeration.  This gets the food out of the temperature danger zone (40-140F) where bacteria multiply rapidly, and doesn't rely on maintaining a sterile environment in your pot.  

Sous vide cooking is an exception: with a sealed bag, you're recreating Louis Pasteur's famous proof of the germ theory. In his experiments, he sealed boiled broth in containers that prevented dust particles (carrying microorganisms) from contaminating them.  The sealed containers did not spoil.  Of course, this ignores the problem of botulism: the spores aren't killed, even at a full boil, and can then germinate and start to multiply.  This (and similar pathogens) are why sous vide foods do not have infinite shelf life in their bags.