The date of the Gondor's loss of Umbar is not recorded. All we know for sure, from Appendix A to The Lord of the Rings, is that '...in the evils that soon befell Gondor Umbar was again lost, and fell into the hands of the Men of Harad'. The 'evils that soon befell' were the waves of assault on Gondor, especially by the Wainriders, that started in III 1856.
The fact that Umbar 'fell into the hands' of the Haradrim seems to suggest that Gondor voluntarily withdrew its occupying force to meet the Wainrider threat, rather than losing it to military action. This is open to question, but what seems clear is that the Haradrim permitted, and indeed probably encouraged, the Corsairs to resume their raids on Gondor's coasts.