The State Pension you will be entitled to will be calculated based on your National Insurance (NI) record when you reach the State Pension age. Your NI record documents how many years you have been paying NI contributions for.
You'll usually need 10 qualifying years on your NI record to get any State Pension and at least 35 qualifying years to get the full State Pension. You receive a qualifying year on your NI record if you're employed and earning over £184 a week from an employer (over ~£9.5k a year).
When you exchange part of your salary for pension contributions, you end up paying less tax in the form of NI but this is not taken into account on your NI record - as long as you earn more than ~£9.5k a year, you will be recorded as having a qualifying year.