The hepatitis B vaccine is highly effective, providing more than 90% protection for those who complete the full vaccination series. The vaccine involves a series of three or four shots given over a six-month period. Immunity usually lasts for at least 20 years, and in some cases, it can last a lifetime.