A long time.
Usually a course of allergy shots will run for at least 2-3 years. They slowly ramp you up to the maximum dosage (which can take a year), keep you at the maximum for about a year (or longer) and then may taper you off. In some cases, when they taper off the shots your symptoms will return and they have to start over.
It's a long-term commitment.