When it comes to members of U.S. Congress, annual pay is pretty cut and dry: Salary for most is $174,000 per year (though those in leadership positions like the Speaker of the House make more). According to PolitiFact, a long-standing urban legend has convinced many people over the years that rank-and-file members of the House of Representatives only have to serve for two years in order to receive $174,000 annually for the rest of their lives. Unfortunately for members of Congress, the legend is, well, a legend.
A report on "Retirement Benefits for Members of Congress" stipulates that no member of Congress is eligible to receive pension until they've served for at least five years (senators serve six-year terms, but members of the House have to seek reelection every two years). There are other provisions as well: The congressperson or senator has to be 62 years old or at least 50 with 20 years of service (or, if they're whiz kids, they can be any age, as long as they've served for 25 years) before they can begin receiving their pension.
And that $174,000 rumor isn't quite right either. According to the Federal Employees Retirement System (FERS), basic pension plans depend on their years of service and the representative's "high-3" average (i.e. their three highest-paid consecutive years of service). There's some other math that goes into figuring out the final number, but, for example, a rank-and-file member who's served for 25 years can expect to take home about $67,250 per year in pension. But a congressperson who's only served three terms (or one if they're a senator) might only get $17,588 if they retire after six years.
Members of Congress can also enjoy other retirement benefits thanks to FERS: Social Security and the Thrift Savings Plan (TSP). If a government employee is covered by FERS, they pay into their Social Security fund at the same rate as private employees. But they also have the option to invest in the TSP, which is available to all federal employees and is similar to a 401(k). According to Investopia, what's so great about the TSP is the plan has super-low operating expenses compared to those outside of the TSP (38 cents in expenses for every $1,000 invested compared to $1.20 per $1,000 invested). That means their nest egg grows faster than most because low expenses help them achieve "high long-term investment returns." Not too shabby if you can put up with everything else that goes along with public service these days.