Budgies usually live 8-10 years if cared for well. Sometimes they will live to about 15 years. It is rare, but some budgies have lived more than 20 years. The most important thing is a healthy diet. A budgie on a seed-only diet will probably live only 4-5 years, at the most. Exercise and a diet supplemented with fresh fruits and veggies can help to ensure good health and longevity.
As for the longest a budgie has ever lived, I found a website that reported that “according to the Guinness Book of Records the oldest budgerigar ever lived in England. He was called Charlie, and he reached the ripe old age of 29 years and 2 months.”