Currently, experts do not know exactly how long the virus can stay infectious (outside the laboratory) because it is so new and different environmental conditions, like humidity and temperature, or exposure to direct sunlight, can affect its viability outside the body. Scientists currently estimate that the COVID-19 virus can survive on hard surfaces, or in the air, on the order of hours, but can be killed by wiping down surfaces with a bleach or alcohol-based disinfectant, trapped by helping to keep indoor air "clean" with filters and face coverings, or diluted from indoor air by improving ventilation.
It is important to note that new research suggests that contaminated surfaces are not a main pathway for infection, and more people become sick through contact with virus particles in the air, such as when someone who is infected coughs, sneezes, talks, or breathes. The best way to protect yourself is to avoid close contact with others and avoid poorly ventilated spaces, wear a mask and avoid touching your face, as well as washing your hands with soap and water for at least 20 seconds.
For a thorough description of how to protect yourself from COVID-19, check out the Swiss Cheese Respiratory Virus Pandemic Defense.
Updated 7 December 2020