Prior COVID-19 infection provides immunity against the virus for at least three months in the vast majority of patients, a study published Wednesday by JAMA Internal Medicine found.