Following the discovery in 1952 that the tuberculosis drug iproniazid elevated the mood of people taking it, and the subsequent discovery that the effect was likely due to inhibition of MAO, many people and companies started trying to discover MAO inhibitors to use as antidepressants. Selegiline was discovered by Zoltan Ecseri at the Hungarian drug company, Chinoin (part of Sanofi since 1993), which they called E-250.  Chinoin received a patent on the drug in 1962 and the compound was first published in the scientific literature in English in 1965.  Work on the biology and effects of E-250 in animals and humans was conducted by a group led by József Knoll at Semmelweis University which was also in Budapest.
Deprenyl is a racemic compound (a mixture of two isomers called enantiomers). Further work determined that the levorotatory enantiomer was a more potent MAO-inhibitor, which was published in 1967, and subsequent work was done with the single enantiomer -deprenyl.
In 1971, Knoll showed that selegiline selectively inhibits the B-isoform of monoamine oxidase (MAO-B) and proposed that it is unlikely to cause the infamous "cheese effect" (hypertensive crisis resulting from consuming foods containing tyramine) that occurs with non-selective MAO inhibitors. A few years later, two Parkinsons disease researchers based in Vienna, Peter Riederer and Walther Birkmayer, realized that selegiline could be useful in Parkinsons disease. One of their colleagues, Prof. Moussa B.H. Youdim, visited Knoll in Budapest and took selegiline from him to Vienna. In 1975, Birkmayers group published the first paper on the effect of selegiline in Parkinsons disease.
In the 1970s there was speculation that it could be useful as an anti-aging drug or aphrodisiac.
In 1987 Somerset Pharmaceuticals in New Jersey, which had acquired the US rights to develop selegiline, filed a new drug application (NDA) with the FDA to market the drug for Parkinsons disease in the US.  While the NDA was under review, Somerset was acquired in a joint venture by two generic drug companies, Mylan and Bolan Pharmaceuticals.  Selegiline was approved for Parkinsons disease by the FDA in 1989.
In the 1990s, J. Alexander Bodkin at McLean Hospital, an affiliate of Harvard Medical School, began a collaboration with Somerset to develop delivery of selegiline via a transdermal patch in order to avoid the well known dietary restrictions of MAO inhibitors.  Somerset obtained FDA approval to market the patch in 2006.