I'm not sure exactly how long but I do know it's a long time. It depends on how long your hair is as well. You are looking at least a year if it's long.
All drugs stay in your hair indefinitely. Most hair follicle tests go back 90 days. If you have used in that time, it will show up.