You mean to pass a drug test? It depends on how much of it is your system, statistics are 2-30 days.
Xanax has a half-life of 11.2 hours, so roughly expect to lose half of it in your blood plasma concentration in that amount of time, and so on, and so on, and so on (keep halving the remaining mgs), until it's below detectable trace levels. Benzo's hang around about the longest next to cannabinoids.