The credit will go away and you will have to pay off the balance of the phone. Assuming you purchased an iPhone 7 with 32GB of storage the phone cost $650 at launch. You should have 1/2 paid off by now, and AT&T will charge you $325 to pay off the rest of the phone because the agreement last year was that you would keep the phone for 24 months. AT&T will not allow you to send the phone in to waive the rest of your "payments".
I don’t believe this is the case or AT&T doesn’t have a clue. Everyone I have talked at AT&T has said a line eligible for an upgrade (paid more than 12 payments on a 24 month next plan) can trade in the iPhone 7 toward the X. They did say that the phone has to be in good condition with no water damage. The credits won’t continue.