It depends on your provider. Some lend you the router rather than sell it, so check who owns yours and whether they want it back. Many will post you a returns bag or send you a link to a returns label once the service ends. If nothing arrives, ask them for instructions.
Ask what the return deadline is and what you'll be charged if you miss it. Charges are usually per item and can include boosters and TV boxes.
Factory reset it first so your Wi-Fi passwords don't go with it — follow your provider's or the manufacturer's reset instructions — and hang on to the proof of postage. If your provider confirms they don't want it back, take it to a WEEE recycling point rather than binning it.
One to sort before you leave: make sure they have your forwarding address, or the returns bag turns up at your old home.