I took the Hep A vaccine and then six months later took a booster and it supposedly lasts for life. But you have to get the booster. I read that Hep B vaccine is similar. Here's some more info that I pulled out of an article:
Both the vaccines for hepatitis A and the vaccines for hepatitis B are highly effective. In studies of the four vaccines used for hepatitis A, nearly 100% of all adults who receive one develop protective levels of antibodies within one month of receiving a single dose. In addition, eight years after receiving two or more doses, 99% to 100% of vaccinated individuals were still fully protected. Results are similar for the hepatitis B vaccine, and experts estimate that both vaccines will give immunity for up to 20 or 30 years and possibly for life.
As with all medications, there is the potential for side effects. But the safety record of both vaccines is outstanding. The most common side effect of the hepatitis B vaccine is soreness at the site of the injection. Since 1982, when the hepatitis B vaccine became available in the U.S., more than 100 million people have been vaccinated with no report of serious side effect. In that same time period, the incidence of acute hepatitis B declined by about 82%.
Mild side effects for the hepatitis A vaccine include soreness at the injection site,headache, loss of appetite, and tiredness. Serious side effects include a severeallergic reaction within a few minutes to a few hours of receiving the shot, but such occurrences are extremely rare.
Here's a link to the article. I found the passage above on page 2:
Hope this helps!