This question does not have a simple answer, since the idea has
been around for a long time in various forms. Adam Smith wrote
about how people have to work to produce things, and so production
used to make one thing (in his example, beaver skins) can't be used
to make another (deer). David Ricardo, Karl Marx, and Leon Walras
further developed the theory of value. The "Austrian Marginalists,"
such as Karl Menger, Eugen Böhm-Bawerk, and Fredrick Wieser figured
out that it was the marginal not the average benefits and costs
that determined price, not the average benefits and costs.
Frank Knight and Alfred Marshall worked on how supply and demand interact with opportunity costs, but never developed the full modern version of opportunity costs. It was not until Mises, Robbins and Hayek came along that a full modern subjectivist concept of opportunity cost was developed, but they certainly did not figure it out on their own.
My reference is mostly James Buchanan's "Cost and Choice," which provides an excellent history of opportunity costs. A full version is available here: http://oll.libertyfund.org/index.php?option=com_staticxt&staticfile=show.php%3Ftitle=1068&Itemid=27
Sorry for not giving you a shorter answer. If you need it for a quiz or something, I would say put Fredrick Wieser, who coined the term.