The Centers for Disease Control and Prevention (CDC) has identified that four weeks after being infected with Covid-19 is when post-COVID conditions can be first identified. A study that tested thousands of healthcare workers found that people who have been previously infected with Covid-19 are likely to be protected from reinfection for several months, but they could still carry the virus in their nose and throat and transmit it to others. Natural immunity may not offer much protection against variants of COVID other than the one you were infected with. If you were previously hospitalized with COVID and then received two mRNA vaccines, that combination of protection was 35% effective in preventing subsequent hospitalizations during the first omicron wave.
The bottom line is that contracting COVID gives you some natural immunity, but it doesn't mean you have complete and lasting protection. According to Dr. Allison Arwady, data has shown that most people infected with COVID are protected from the virus for about one to three months afterwards. For a long time, laboratory data suggest that a previous infection with the original omicron is not very protective against reinfection with the new mutants, although the true risk of being reinfected regardless of the variant is unique to each person and situation.
If you contracted an earlier variant before the arrival of omicron, that meant you had an 84% lower risk of infection, which significantly reduced your risk of contracting COVID again, especially in the months immediately following the illness. Still, some people may get sicker when they become reinfected, for example, if someone is exposed to a much larger amount of virus than in the first infection or if a person's immunity against Covid has dropped significantly. CDC is working with several public health jurisdictions that are identifying reinfections to collect and analyze data. The same precautions used to prevent infection (masks, distancing, vaccinations, and more) work just as well to avoid reinfection.
Several studies have found that people who have been infected with COVID-19 continue to produce antibodies to the virus for seven or eight months after recovery, which is a good sign that immunity should last for a while. Whether people become reinfected depends on the strength of the immune response when they were exposed, as well as whether they were recently vaccinated.