If you're not careful, you could end up carrying your student debt until you're old(er) and gray.

When most people think about borrowing money for college, they anticipate paying back that debt during much of their 20s, and possibly even their 30s. But if you're not cautious about borrowing, you could end up carrying that debt so long that you're still making payments by the time your own kids enter college.

That's right -- 39% of borrowers don't pay off their student loans until they're over 50, according to data from Principal Financial Services. It's no wonder, then, that 50% of borrowers claim that their student loans are preventing them from achieving other major financial goals.

If you're planning to borrow money for college, let this be your warning: You could end up carrying that debt for several decades to come. And that could impact not just your lifestyle in adulthood, but your retirement, as well.

Don't get in over your head

Borrowing money, whether it's for college or to buy a home, always comes at an opportunity cost. But if you rack up too much college debt, you risk not only having those payments haunt you throughout adulthood, but they also may prevent you from retiring on time -- or at all.

According to Morningstar, for every $1 of student debt you accumulate in pursuit of that degree, you'll decrease your retirement savings by $0.35 -- regardless of how much you end up making during your career. In other words, if you borrow $37,000 for college -- which is what the average Class of 2016 graduates came away with last year -- you'll have $13,000 less in retirement. Borrow $100,000, which is what many students have to do to attend private universities, and you'll be short $35,000 come retirement.

It's not just retirement you have to worry about. An estimated 40% of recent graduates have held off buying a home because of their student loans, according to TD Ameritrade. And more than 20% of borrowers in their early- to mid-20s have delayed getting married, or starting their families, as a result of having too much debt.

A smarter way to borrow

Most people can't afford college without some sort of financing. But if you pledge to keep that debt level as low as possible, you'll walk away minimally unscathed on the student loan front.

The best place to start? Keep your costs low to begin with. There's a huge gap between private college tuition and that of community or public in-state tuition. Read up on those differences, and choose the school with the lowest associated bill.

Here's what tuition looked like for the 2016-2017 school year:

College Type

Average Cost of Tuition

Community

$3,520

In-state public

$9,650

Out-of-state public

$24,930

Private

$33,480

DATA SOURCE: THE COLLEGE BOARD.

As you can see, you stand to save $23,830 a year by opting for a four-year, public in-state school over a fancy private one. That means you could potentially borrow $95,000 less over the course of your degree, which would, according to the above formula, put $33,000 back in your pocket for retirement. Furthermore, if you choose a school that's commutable, you'll save $10,000 or more a year on room and board -- not exactly pocket change.

It's not just how much you borrow that could impact your financial future -- it's also the way you borrow. Since most people only qualify for so much in federal loans, if your costs exceed that figure, you may be tempted to borrow privately for college. Don't.

Private lenders are notorious for charging exorbitant amounts of interest, and they offer little to no flexibility as far as repayment goes. Federal loans, on the other hand, offer income-based repayment plans and other accommodations that make borrowing for college just a bit less stressful.

Nobody expects to be paying off student debt at age 50 or over, but if you're not careful about the way you borrow, that could end up being your story. Don't fall into that dangerous trap. Keep your higher education costs to a minimum, limit yourself to federal loans, and work as needed to make up the difference. You'll be thankful for it when you're older.

The Motley Fool is a USA TODAY content partner offering financial news, analysis and commentary designed to help people take control of their financial lives. Its content is produced independently of USA TODAY.

Offer from the Motley Fool: The $16,122 Social Security bonus most retirees completely overlookIf you're like most Americans, you're a few years (or more) behind on your retirement savings. But a handful of little-known "Social Security secrets" could help ensure a boost in your retirement income. For example: one easy trick could pay you as much as $16,122 more... each year! Once you learn how to maximize your Social Security benefits, we think you could retire confidently with the peace of mind we're all after. Simply click here to discover how to learn more about these strategies.