"Making Hay" is short for "Making hay while the sun shines". If you cut or harvest hay during inclement weather (e.g. rain) the hay becomes heavy and hard to rake and bail but even worse it will mold and become useless. You can only make hay while the sun shines. Simply put, it means to be highly productive for a limited period of time when the opportunity is present. (Thanks to Phrase Origins)