Doctors' advice, at this point, is for recovered patients to wait three months after recovery. Why, I don't know.
It is known that recovered people have antibodies against the Covid virus, and T-cells that will "remember" how to make those antibodies again, months later.
Similarly, it is known that vaccinated people have antibodies against the Covid virus, and T-cells that will "remember" how to make those antibodies again, months later.
The reason we do not know how long those immunities will last is that Covid has only been in circulation in the US a bit over a year (some 16 months, counting the very earliest known), and while it is known that the antibodies persist in significant levels for as long as we have data, it cannot be known how long those immunities will last.
My opinion, currently, is that doctors are either poorly informed (due to being very busy people) or are being ultra-cautious, and are advising recovered people to receive vaccinations they do not need.