This comes in a speech by Brutus in Shakespeare’s Julius Caesar:
There is a tide in the affairs of men,
Which, taken at the flood, leads on to fortune;
Omitted, all the voyage of their life
Is bound in shallows and in miseries.
On such a full sea are we now afloat;
And we must take the current when it serves,
Or lose our ventures.
There is a right moment to undertake something successfully and if we fail to grasp it, we do so at our peril. Other proverbs on this theme are listed under Opportunity seldom knocks twice.