All current evidence says infection confers temporary immunity to the vast majority of people infected. It’s not clear how long immunity lasts, but it’s most likely on the order of years. And even if you lose immunity, the reinfection will likely be more mild.
I think the jury's still out on the odds of achieving even temporary immunity after having caught it.