Typical home loan terms are 15 years and 30 years, and I'm starting to see 40 year loans creep up now. Generally, the shorter the loan term the higher the interest rate. But still, paying a 15 year mortgage at 5% will mean you will pay less than a 30 year mortgage at 4%. How fast you pay it off depends on how much extra you include with each payment towards the principle. For example, I have one rental property I acquired in 2002 on a 30 year loan which I paid off in 2013 or 14 (can't remember exactly). The early payoff saved me over $100K in interest payments. Working on paying off the 2nd mortgage now.
If you want to play with actual numbers, use the attached spreadsheet. For protection against what I call "stupid typo errors" that can screw up the formulas, I've locked fields that should not be changed. If you want to unlock it, the password is the word "password" without the quotation marks.