Most people can agree that living longer is a good thing. We all want to spend as much time as possible enjoying our golden years, and for most of us, it would be a dream to live well into our 90s or even past age 100.

However, our wallets may not agree. The majority of soon-to-be retirees are woefully unprepared to retire. In fact, a third of Americans have absolutely nothing saved for retirement, according to a survey from GOBankingRates, and among older workers, the numbers are even more troubling: The Insured Retirement Institute reported that a full 46% of baby boomers don't have any retirement savings.

Senior man and woman sitting at a table looking concerned

Image source: Getty Images.

But what if you're one of the few people who have been painstakingly preparing for retirement for decades? You've done everything right -- you've been dutifully contributing to your 401(k) throughout your career, you know your retirement number, and you've done your homework to determine how much of your savings you'll spend each year during retirement.

Unfortunately, that alone may not be enough to ensure your savings last the rest of your life.

The downside of living longer

Americans are living longer than ever. One in five people turning 65 today can expect to live past age 90, according to the Social Security Administration, and 1 in 10 will make it past age 95. That's great news for retirees but not-so-great news for their retirement funds.

Many people assume they'll spend 20 or 25 years in retirement. However, say you retire at age 62 and are among the 10% of people who live past 95. That means you're spending at least 33 years in retirement, and if your savings run dry after 25 years, those last few years won't be the most enjoyable of your life. Not to mention the fact that your retirement may not go exactly according to plan, and unexpected costs (like medical expenses) may force you to spend more than you had planned, leaving you with even less money in your golden years.

Living six or seven years longer than you had planned might not seem like a big deal, but it could cost you several hundred thousand dollars -- especially when you consider inflation. For example, say you're retiring today at 62 years old, and you know you'll need $50,000 per year to cover all your basic living expenses. Assuming inflation averages 2.5% per year, in 25 years, it would take $93,000 to cover those same expenses.  So if you run out of money at age 87 and ultimately end up living until 95, you may need upward of $810,000 to cover basic expenses for the next eight years -- and that's not including costly healthcare expenses or long-term care costs that could arise.

Planning for a longer retirement

Even if you're diligent about retirement preparation and plan on living for more than 30 years after you retire, you can't plan for everything. Life will get in the way, healthcare costs will likely pop up, or you could move to a more expensive city that throws your retirement budget out of whack.

One way to mitigate the risk of unpleasant financial surprises in your later years is to delay your Social Security benefits. The amount you receive in Social Security depends on when you start claiming benefits. You can file as early as age 62, but you'll receive smaller checks for every month you claim before you reach your full retirement age (FRA), which is the age at which you'll receive 100% of your promised benefit amount.

However, if you delay claiming benefits beyond your FRA (up to age 70), you'll receive a boost in benefits. The beauty of delaying benefits is that the bigger checks will last the rest of your life. So if you do end up living into your 90s, you'll still be reaping the rewards of those extra benefits. And over time, that extra money can add up significantly.

For example, say you were born in 1960, making your FRA 67 years old, and the full benefit amount you would receive if you claim at that age is $1,300 per month. If you claim at 62, your benefits will be cut by 30%, leaving you with $910 per month. If, however, you wait until age 70 to claim, you'll receive an extra 24% on top of your full benefit amount, bringing your monthly total to $1,612. If you had claimed at 62, the total amount you would have received in benefits by age 95 (not accounting for yearly adjustments for inflation) is $360,360. If you wait until 70, you'll have received $483,600 by the same age -- a difference of more than $123,000.

Also keep in mind that you don't necessarily have to claim Social Security benefits when you retire. If you have enough savings, you can still retire at 62 and then wait until 70 to claim Social Security. That way you don't necessarily need to delay retirement, but you can still earn that boost in benefits by waiting to claim Social Security.

Although Social Security benefits alone may not be enough to cover all your expenses if your own savings run dry during retirement, they can help significantly -- especially at a time when you can't simply go back to work to earn more money. In the event that you live longer than you anticipated, those bigger checks will make your golden years far more enjoyable.