I know that you have to pay off any outstanding EIP.
None of the carriers prorate partial months, so you want to port out in the last week of the billing cycle, to avoid paying for days not used.
You might be one of the few customers who are still under contract. That you'll have to determine yourself.
There are some strings attached with corporate discounts, if you have one. You might want to ask about that.
You go to the new carrier with your phone and maybe a bill and ask them to port your number over. They take care of the details.
I think the only reason T-Mobile might decide to prorate your bill is if they were dropping you, not the other way around.
Don't know any of the other answers.