Can you tell me if I am prescribed the pill to treat a hormonal imbalance, will I have to take it for the rest of my life?

It depends. I would have to know what the hormonal condition is. Some may require lifelong replacement or treatment with monitoring. .