Hi Alina!
Just as Gemma said, it is to reduce the risk of blood clots. Strange that your surgeon didn't explain that. Mine was very very VERY specific about it and said that he'd refuse to operate on anyone who had not been following his instructions to stop.
Different surgeons seems to suggest different times though. For me it was 4 weeks before surgery (as I was on pills) and I had to stop the anti-androgens too. He said that anti-androgens are probably safe but since they couldn't say for sure it was better to stop taken them too.
For those on shots, the time to stop taking them was 8 weeks before surgery.
Hope everything goes well for you!