Every retiree suffers from the same nightmare self-questioning: What happens if I outlive my money?

Since none of us knows exactly how long we'll live, or what the economy might do in the future, how will we ever know if we've saved and invested enough to get us through our remaining years? Many folks who retired right before the bubble of the 1990s burst -- some of whom thought the 20%+ annual gains would go on forever -- are back in the workforce, trying to replace the chunk they lost in the markets.

But rather than be paralyzed by fears and plagued by visions of pushing the cat out of the way to get at the kibble, let's look at a simple planning technique that you can use to determine what you'll need in your retirement account before you can afford to wind the gold watch and sign up for the daily golf league.

Too many retirement planners work from an assumed life expectancy, usually taken from a life insurance chart. If we knew how long we were going to live, planning would be as simple as betting against the U.S. to get out of the first round of the World Cup. (I know, it was a cheap shot, but c'mon -- one goal in three games?)

What about those lucky souls who live a decade beyond their three score and ten? How horrible would it be to have the good fortune to live a long, healthy life, but not the means? So what's an investor to do?

The 5% solution
Let's look at an industry that must plan in a similar way for future spending needs: charitable foundations. These organizations assume that they'll have no endpoint. Ideally, they will exist forever, generating income each year to support their charitable functions. So the caretakers of these foundations need to invest for growth for two primary reasons. First, they need to stay ahead of inflation (so do you). And second, they hope to increase their annual spending in order to expand their charitable mission. Unless you want an upgrade on your current standard of living, you don't have that second burden; you just need to stay ahead of inflation so that you can maintain your lifestyle throughout the rest of your years.

What's their secret? They limit their spending each year to a small percentage of their total assets. Most foundations budget their annual spending at 5% or less of their total assets.

If you're a stock investor, you probably already know that the S&P 500 Index has averaged an annual return since the 1920s between 10% and 11%. So if the foundation's assets are growing at a rate of 10% a year, and it's pulling out no more than half of that to spend on its annual programs and expenses, the remaining profit covers inflation and some growth. Of course, a market-beating return would give the portfolio an even better gap between spending and growth, but for the sake of simplicity, let's stick with the 10% round number.

Your portfolio won't generate that kind of return every year, of course. Some years you'll do far better, and in others you may even lose money. (Gasp! We haven't forgotten the first few years of our current millennium now, have we?) But even a bear market like we saw when the last tech bubble popped won't derail this kind of plan if you're limiting your annual spending needs to a small percentage of your portfolio. You may be exceeding your 5% target for a year or two until the market rebounds and your portfolio recovers, but you won't be in danger of running out of assets altogether and having to hunt for a part-time job.

The magic number
What's the magic number, then? The quick and dirty method is simply to figure out how much money you would need your portfolio to generate today in order to sustain your lifestyle for the next year. So, if a small cabin and a nice bicycle is your idea of living the good life, you may only need a modest annual "salary." But if you're planning to keep driving that Hummer and maintaining houses on both coasts and a pied-a-terre in the south of France, your portfolio is going to have to be, shall we say, bloated.

If you have guaranteed retirement income from other sources -- and I mean sources that are truly guaranteed, not just a wink-and-a-nod promise of one -- don't include it in your calculations, because you won't need your investment portfolio to produce that income. Your magic number for annual expenses should only be the figure that your stock portfolio will have to generate in growth.

Let's say -- again, so I don't have to pull out a calculator and hurt myself -- that you need your portfolio to generate a nice round $50,000 a year for you to live the style you anticipate keeping until your relatives contest the will for the rest. If you're using 5% as your maximum annual withdrawal, that annual "salary" you're going to pay yourself has to be no larger than 5% of your total portfolio.

So multiply your annual "salary" by 20. That product is your retirement target today. (It can change, of course, if your needs change or inflation shoots up before you take retirement.) Write the number down somewhere and chant it to yourself during the next mind-numbing committee meeting. Look at your current portfolio and see how far away you are. Try to project how much you still have to save and earn through growth before you hit the target. However you enshrine this number into your life, try to use it as both a legitimate planning tool and an inspiration to keep saving and investing Foolishly, so that you get there sooner rather than later.

For related Foolishness:

It's never too early or too late to start planning your retirement. Try a risk-free trial to Rule Your Retirement today to get started.

If you're interested in educating yourself about charitable institutions and the Foolish community, check out our Foolanthropy website.

When he's not on his bicycle or watching Newcastle United struggle vainly to qualify for European play, Fool contributor Robert Sheard is an English teacher. He's also the best-selling author of two investment books, The Unemotional Investor and Money for Life.