late 14c., opportunitie, "fit, convenient, or seasonable time," from Old French opportunite (13c.) and directly from Latin opportunitatem (nominative opportunitas) "fitness, convenience, suitableness, favorable time," from opportunus "fit, convenient, suitable, favorable," from the phrase ob portum veniens "coming toward a port," in reference to the wind, from ob "in front of; toward" (see ob-) + portus "harbor" (see port (n.1)).
Opportunity cost is attested from 1911. The expression opportunity knocks but once (at any man's door) is attested from 1898.