TL;DR: The N% efficacy reported for a vaccine means that N% of the cases in the controls could have been prevented had they been vaccinated.
You have a few different question mushed together, so here are some key insights (you can read the first of many publications on safety and efficacy for both vaccines linked in my references as the end of my answer):
Vaccine efficacy, also termed the preventable fraction (Rothman and Greenland, 2008), is defined as:
$$\text{vaccine efficacy} = \frac{\text{rate}_{\text{controls}} - \text{rate}_{\text{vaccinated}}}{\text{rate}_{\text{controls}}}$$
Sometimes this fraction is expressed as the mathematically equivalent:
$$\text{vaccine efficacy} = 1 - \frac{\text{rate}_{\text{vaccinated}}}{\text{rate}_{\text{controls}}}$$
In these formulas $\text{rate}$ is a measure of the risk of COVID-19 infection as the studies' primary endpoints:
- For the Pfizer mRNA vaccine, that specifically was "confirmed Covid-19 with onset at least 7 days after the second dose in participants who had been without serologic or virologic evidence of SARS-CoV-2 infection up to 7 days after the second dose," Polack, F. P., et al., 2020.
- For the Moderna mRNA vaccine, that specifically was "a first occurrence of symptomatic Covid-19 with onset at least 14 days after the second injection in the per-protocol population, among participants who were seronegative at baseline," Baden L. R., et al., 2021.
Risks are always expressed for a given unit of time—like a year, or 90 days, or for both these vaccine trials, cases per 1000-person years.
The vaccine efficacy fraction expresses how much of the risk for COVID-19 infection in the unvaccinated (controls—participants receiving a placebo in these studies) could be prevented via vaccination. Risk (also known as an "incidence rate") can generally be measured in two ways (incidence densities or incidence proportions), but in randomized control trials, they are very often measured as incidence densities, which is a way of averaging observed risk across study participants who have been observed for differing lengths of time (for example, one subject may have been observed for 27 days before contracting COVID-19, while another may have been observed for 67 days before contracting COVID-19).
The 90-something percent efficacies reported for both the mRNA vaccines means that more than 90 of the cases of COVID-19 in the controls could have been prevented had they been vaccinated. Of course, there's lots of additional details and assumptions (e.g., what strain was prevalent during the randomized control trials, and so forth).
Different endpoints require different measurements and will necessarily have different efficacy measures. For example, efficacy against COVID-19 mortality is not the same as efficacy against COVID-19 infection. And the 1 year efficacy is not the same thing as the 30-day efficacy (for many reasons, including prevalence of COVID-19 infections, prevalent strains, reproductive rate of infection, behavioral changes due to perceived risk and distributions of such behaviors, decay in immune response from acquired immunity, etc.).
References
Baden, L. R. et al., (2021). Efficacy and Safety of the mRNA-1273 SARS-CoV-2 Vaccine. The New England Journal of Medicine. 384(5), 403–416.
Polack, F. P., et al., (2020). Safety and Efficacy of the BNT162b2 mRNA Covid-19 Vaccine. The New England Journal of Medicine, 383(27), 2603–2615.
Rothman, K. J., Greenland, S., & Lash, T. L. (2008). Modern Epidemiology (3rd ed.). Lippincott Williams & Wilkins.