An opportunity can be lost in the blink of an eye but regret can last forever!
Chances tend to be brief, while the memory of a missed one can linger for years. The saying sets two very different lengths of time side by side: the instant in which a door opens and closes, and the long stretch afterward in which we replay what we might have done. Its warning is less about failure than about hesitation, since the things we try and fail at usually sting less over time than the things we never dared to try.
It belongs to an old line of thought. The Greeks had the idea of kairos, the opportune moment that must be seized as it passes, and Horace's "carpe diem" urges us to make use of the day because the future is uncertain. Since the words are credited to no known author, they read more like shared folk wisdom than one thinker's doctrine.
In practice, imagine you have been thinking of applying for an evening course, or of calling an old friend you drifted away from. Instead of waiting for the perfect moment, you take one small step today: you fill in the form or send a short message. It will not guarantee the result, but you won't be left wondering.