It becomes less effective after exposure to the virus. You can get it as an older patient, but it drops to under 50% effectiveness after exposure.
Hence why there is a push to vaccinate children before they become sexually active: the effectiveness is around 95%.