One of the factors to consider is your age and how far you are from retirement. You should also think about things like when your home loan term ends, when your children will graduate and start working, and when your partner plans to retire. It makes sense for your term to last through these events.
You will also want to consider your own savings and investing. If your savings and investments are growing quite quickly, you may need insurance for a shorter term, as you will 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.