What happens if the interval between the 2nd and 3rd vaccine for the hepatitis b virus is too long?

Nothing. Ideally, the third dose is six months after the first dose but you never restart the series. If you have had the first two doses, it is never too late for the third dose.
Temporary changes. There may be a transient drop in protection generated by the initial vaccines, but finishing the series will bring it back to a protective level.