Long-term protection to this virus comes from antibodies, small proteins produced by your immune system that attack the virus and neutralise it so it cannot be spread and cannot do any more damage to the person infected. These antibodies emerge during an infection and peak 28 days after the infection. They then remain for months afterwards continuing to provide protection, and the cells that produce them also are available to fight off the infection if it returns.
These antibodies see anything foreign (like a virus) and bind to many different parts of the virus. Some antibodies are better than others at providing protection; they are called neutralising antibodies. There is obviously much interest in developing tests that detect these antibodies so that people know they will be safe even if exposed to those with the infection. It may be that many people get this infection without severe symptoms so many may have protection and not know it.
Source. Oxford University. Full post. https://www.research.ox.ac.uk/Article/2020-04-05-trouble-in-testing-land