What plan do you have? Plans have no contract but device payment plans might have a set time length unless you pay it off early. You’d need to contact T-Mobile to find out for sure. This is a customer to customer community.
Manage your T-Mobile account