The short answer is: it depends. Most internet providers own the router so when you upgrade or switch to a different ISP they will ask you to return it.
If you’ve bought your own router, and it’s compatible with the broadband you’re buying, no problem.
But if you didn’t buy it, it belongs to your previous internet provider.
If it is fairly old technology it’s less likely they’ll bother asking for it back. Still, if you’re upgrading to fibre broadband, your old router may not work anyway.
It’s worth remembering to read the letter you receive with your new router. They may still demand it back and include the shipping labels required.