Buying a new home is a big decision. Most people focus on the number of bedrooms or kitchen appliances, but new homebuyers should be thinking more about how much mortgage they truly can afford.

It's a question many people may be facing soon. Almost three-quarters of Americans believe now is a good time to buy a home, according to a recent homeownership survey from the National Association of Realtors. Interest rates are slowly rising, and the housing market has recovered in many areas of the U.S. With mortgage defaults still at relatively low levels, banks are eager to lend to prospective homebuyers.

The problem is, many Americans qualify for mortgages that are larger than they can easily afford. Taking on that big of a burden can hurt your ability to reach your other financial goals, such as saving for kids' college education or your retirement.

Financial planners recommend limiting the amount you spend on housing to 25 percent of your monthly budget. Yet the average married couple with children spends just over 31 percent of their budget on housing, and single people spend almost 36 percent, according to the most recent data from the Bureau of Labor Statistics. 

That's a big reason more than 80 percent of current homeowners say their mortgage payment makes it difficult for them to save money, according to a recent Bankrate report. Parents in particular have a hard time juggling their competing financial priorities.

So to make sure you don't fall into that trap, here are some tips for getting an affordable mortgage:

Follow the 25 Percent Rule

There’s a straightforward way to make sure you can afford your mortgage while managing your other goals, according to Eve Kaplan, a certified financial planner based in New Jersey. “Housing—including maintenance—ideally shouldn’t consume more than 25 percent of a household budget. This goes for folks who rent, too,” Kaplan says.

Mortgage bankers would disagree. They use various calculations to figure out how much you can afford, and the amount is often much higher than financial planners recommend. One common measure is the debt-to-income ratio (DTI), which, for a qualified mortgage, limits your total debt payments, including your mortgage, student loans, credit cards, and auto loans, to 43 percent.

Many homebuyers see their home as an investment for the future, which can be an excuse for spending more today than they can easily afford. But real estate can be volatile, as we saw in the 2008 housing crash. Having too much of your net worth tied up in your home can be risky. 

Let’s say you and your spouse make a combined annual income of $90,000, or about $5,600 per month after taxes. Based on your DTI and depending on your other debts, you could be approved for a mortgage of $600,000. That might sound exciting at first, but with a monthly payment of about $3,225, it would eat up more than half of your take-home pay. 

Following Kaplan’s 25 percent rule, a more reasonable housing budget would be $1,400 per month. So taking into account homeowners insurance and property taxes, you'd be better off sticking to a mortgage of $240,000 or less. If you have enough for a 20 percent down payment, the maximum house you can afford is $300,000. 

“People think, 'I’m making really good money, I should be able to afford this,'” says Mary Beth Neeley, a certified financial planner and chief compliance officer at Retirement Strategies, a financial planning firm based in Jacksonville, Fla. “But most people don’t consider saving for the future. You have to put your priorities in place and look at all your goals. You don’t want to have a house that adds stress to your financial situation.”

Neeley asks clients one important question when trying to help them determine what they’re willing and able to spend on housing: “Do you really want to change your lifestyle to have a more expensive home?” 

Aim to Put 20 Percent Down

The amount of mortgage you can afford also depends on the down payment you make when buying a home. “In a perfect world, we recommend a 20 percent down payment to avoid paying mortgage insurance,” Neeley says.

When your down payment is less than 20 percent, your costs rise. You typically have to pay private mortgage insurance, which can cost up to 1 percent of the entire loan amount each year until you build up 20 percent equity in your home. On a $240,000 mortgage, that’s $200 per month. Keep in mind you will have other ongoing costs related to homeownership as well, from taxes to insurance to utilities. All of these expenses need to be estimated before you settle on a monthly mortgage payment.

Consider the 5-Year Rule

Kaplan says homeowners typically need to stay put for at least five years to make the closing costs of buying a home worthwhile. If you are thinking of staying that long, you may be tempted to opt for a mortgage that is higher than you can comfortably afford now. But predicting future income isn't as easy it may seem. Kaplan cautions that stretching your budget can backfire if you become unemployed for an extended period.

Realize Other Expenses May Come Up

Even if you don’t stretch your budget, an unexpected job loss or other life event could cause you to struggle to make your mortgage payment. The more affordable the home was in the first place, the better chance you’ll have of recovering. Building up an emergency fund is easier if you limit your mortgage payment to 25 percent of your take-home pay. The more cash you have on hand, and the lower your monthly obligations, the better chance you’ll have of staying afloat if difficult times strike.