The purpose of term insurance is to act like a financial support for your dependents in case something happens to you.
Ideally it should be for as long as you believe that your children won't get financially settled. Once they start earning and able to cover their expenses, the insurance wouldn't make much sense.
For ex - if your insurance is till the age of 85, your children would probably be around 50-55 yrs old. In most likelihood, they wouldn't care much about the term insurance benefit as they would be already self sufficient.
IMO, the ideal age till which you should take insurance shouldn't be more than 55-65 yrs. Also, the premium will increase exponentially beyond this number.