It's easy to look back on the financial decisions we've made in the past and kick ourselves for not doing better. But it also pays to learn from the mistakes of those who made them before us.

TD Ameritrade recently asked Americans age 40 to 79 to think back on the ways they could've approached retirement savings differently, and 68% said they wish they'd started socking money away earlier in life.

If you're in your 20s or 30s and have yet to begin contributing to an IRA or 401(k), you'd be wise to take the advice of your elders and start carving out money for the future. Wait too long, and there's a good chance you'll come up short.

Middle-aged man with serious expression outdoors

Image source: Getty Images.

An early start is crucial

The sooner you start setting money aside for the future, the more opportunity you'll get to take advantage of compounding. In its basic form, compounding is the concept of earning interest on interest (or accruing interest on interest, in the case of credit card debt).

Here's how it applies to retirement savings: Imagine you put $5,000 in your IRA or 401(k) at age 28, and by 29, your balance grows to $5,300 thanks to the returns that your investments in the account generated. At that point, you can then earn returns not just on your initial $5,000 contribution, but also on the extra $300 you have in your name. Keep that up year after year over a lengthy time frame, and you could wind up with an astonishing amount of money.

In fact, let's say you're able to start socking away $250 a month in your IRA or 401(k) at 22, and you continue doing so until 67. If you load up on stocks in your retirement plan, you're likely to generate an average annual 7% return, since that's a few percentage points below the stock market's average. When we apply that 7% return to those $250 monthly contributions over a 45-year period, we arrive at an ending balance of approximately $857,000.

Now, let's compare that balance to the amount that went into that account out of pocket. A monthly contribution of $250 means $3,000 a year, and 45 years of that brings us to $135,000. But since we wound up with $857,000 in total savings, that means $722,000 of that came from investment gains alone, all thanks to the power of compounding.

But watch what happens when you shorten your savings window to 25 years. Assuming the same monthly contribution and average annual return, you'll be looking at an ending balance of about $190,000. Meanwhile, you're talking about $75,000 in contributions, representing just a $115,000 gain. That's still a decent gain, but it's nowhere close to $722,000.

The point? Don't deprive yourself of years of growth in your retirement plan. You need lots of savings for your senior years to cover your living expenses, so much so that many financial experts recommend closing out your career with 10 times your ending salary put away. If you want a shot at meeting that goal, save from a young age. That way, you'll be able to look back without regrets.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.