Federal law actually prohibits members of Congress from receiving their full salary when they leave office, with the max they can receive being 80% (a limit which would take 67 years to reach). In order to collect a pension a congressman must be 62, or at best 50 with 20 years of service. The minimum time to collect pension is five years in congress, meaning three terms for a representative or one term for a senator, and their pension is based on the highest three years of their salaries and they receive a 1.7% multiplier for the first twenty years of service. So say that you were to go and serve the minimum time required (let's say one term as a senator for simplicity) the base salary is $172,443, so you multiply that by 6 years times 0.017 which gives you a pension of $17,588, which again is only availble after you are 62 years old.

Its not that simple either.
you earn the right for congress pension after 5 years in congress. But you can add your work time anywhere to your work in congress for basis of calculating your pension.
Lets say you are a car salesman for 40 years, you started when you were 19. You serve three terms in congress and earn a congress pension.
Calculation is based on three best years of earning, but their entire work age goes into the calculation. He would end up with about 75% of congressman salary, even if first 40 years of his life he only made 20k a year.