One of the factors to consider is your age. In addition, you should also consider when your mortgage term ends, when your last child will graduate from college, and when your partner plans to retire. It generally makes sense for your term to last through these events.
You’ll also want to consider your own savings. If you’re a person who saves quite a bit each month, you may need insurance for a shorter term, as you’ll sooner rely on your savings instead.
Lastly, the price of your insurance can be a consideration. Longer terms are a bit more expensive per month than shorter terms, which could affect the decision you make.