It varies, depending partly on where the germ-laden droplets fall. Experiments with specific cold and flu germs have shown potential survival times ranging from a few minutes to 48 hours or more. How long such germs remain capable of infecting you in day-to-day life is harder to say.
Germs generally remain active longer on stainless steel, plastic and similar hard surfaces than on fabric and other soft surfaces. Other factors, such as the amount of virus deposited on a surface and the temperature and humidity of the environment, also have effects on how long cold and flu germs stay active outside the body.
It's easy to catch the flu or a cold from rubbing your nose after handling an object an infected person sneezed on a few moments ago. But personal contact with an infected person — a handshake, for example — is the most common way these germs spread.
The best way to avoid becoming infected with a cold or flu virus is to wash your hands frequently with soap and water or with an alcohol-based sanitizer. Also avoid rubbing your eyes or biting your nails. Most importantly — get a flu vaccine every year.