Question about switching carriers & your current number

Are you able to keep your current number when you switch carriers? Or will you have to get a new number?

Edit- I’m switching from AT & T to T-Mobile

Edit- if you’ve done it before what do they do?