It typically takes a few weeks for the body to build immunity after vaccination. That means there's a small chance you could be infected with the virus that causes COVID-19 just before or just after vaccination and get sick. However, if you do get infected after your vaccine has built immunity, the vaccine may prevent serious illness.