Can You Get Infected By Coronavirus Twice? How Does COVID-19 Immunity Work?

Are you immune to the SARS-CoV2 virus after you get infected? If so, how long does this last?