It varies, if it is a final salary scheme it will probably be linked to years of service and salary at the time of retiring or leaving the scheme. For example you can’t normally claim a Teacher’s Pension until you are 60 and then it is linked to years of service, each year of full time service worth 1/80th with 40 years being the maximum you can get. If you worked part time it will be reduced accordingly and if you claim it before 60 it will be actuarily reduced unless you are granted a special pension because of ill health or redundancy. Other schemes vary such as the police pension when you can claim the maximum pension after 30 years service.
Money purchase schemes are more common now and you can access the money in your pension pot when you reach 55 but there is talk of increasing this age to 57. Pensionwise do a useful leaflet outlining the different ways you can use your pension pot and there is useful information on the moneysaving expert website.