The number of doses needed depends on which vaccine you receive and whether you are immunocompromised. To get the most protection for the general public:
Two Pfizer-BioNTech vaccine doses should be given 3 weeks (21 days) apart.
Two Moderna vaccine doses should be given 1 month (28 days) apart.
If you receive a vaccine that requires two doses, you should get your second shot as close to the recommended interval as possible. However, your second dose may be given up to 6 weeks (42 days) after the first dose, if necessary. You should not get the second dose earlier than the recommended interval.