To get the maximum Basic State Pension, you must have 35 qualifying years (which means you must have made National Insurance contributions for 35 years).
For the current tax year – 2022/23 – this would mean a salary of more than £6,396. Above this figure, you start paying National Insurance at (strangely enough) 0% – which counts as a qualifying year. At a salary level of £9,880 (from July 2023, £12,570), the Employee’s National Insurance rate increases to 13.25%. (Employer’s National insurance at 15.05% begins at a salary level of £9,100).