The size of your benefit in retirement depends on how much you earned during your working life. The Social Security Administration (SSA) keeps a record of how much you made every year, up to a ceiling ($147,400 in 2022). Any amount you made over that annual ceiling doesn’t get taxed by Social Security and doesn’t figure into the formula.
When it’s time for you to apply for benefits, the SSA will look at your highest 35 years of earnings. They’ll then apply a formula to arrive at your basic benefit, which is the amount that you will be eligible to collect at your full retirement age. You can find out more about it at the SSA’s website, SSA.gov.