Strongest matches:
* Strike while the iron is hot: This is the most common idiom for acting when conditions are favorable. It emphasizes taking advantage of a temporary opportunity.
* Make hay while the sun shines: Similar to the above, this idiom stresses the importance of working hard during a good time.
Less strong matches:
* Seize the day: While it means living life to the fullest, it can also imply acting on opportunities when they present themselves.
* While the going is good: This is less of an idiom and more of a phrase, but it conveys the same meaning of taking advantage of a favorable situation.
The best idiom to use will depend on the specific situation and the tone you want to convey.