All in the title:
When did scientists realize that our eye functions like a lens/magnifying glass?
People probably realized that the eye contained a lens (at least the eye of a fish) as soon as they began fishing for dinner. So, sadly the discovery of the hard lump that is a fish lens was probably prehistoric. Here is a picture of a fish lens from an Instructable on fish dissection.
Now, we have 3 things left to figure out:
We have a hard, clear lump that humans could have found in a fish's eye. When did humans start to use similarly shaped items to see things better so that we have some idea that they knew what that lump in the fish eye was for?
This article (http://www.wikiwand.com/en/History_of_optics) notes the Nimrud-Layard Lens dated from 750 BCE as the first evidence we have.
Harry Thurston Peck, in Harpers Dictionary of Classical Antiquities (1898) assures us (without a citation) that the ancient Assyrians:
...were acquainted with glass; that they employed the arch in building; that they used the lens as a magnifying instrument; and had, among other mechanical appliances, the lever and the roller.
Euclid describes the geometry of optics in his work, Optics in 300 BCE. And, it is important for us to remember that Euclid was more of a textbook compiler of existing knowledge than someone who was creating and discovering the things he wrote about. Much of his work has been traced back to Sumer.
But, his Optics could be better titled The Geometry of Perspective as they don't really relate to the refractive properties of a lens (although I haven't read them in depth).
In his book, QED: The Strange Theory of Light and Matter, Feynman points out that the evidence that prehistoric man understood refraction goes back to the first successful spearfishing.
Science Learning Hub
For evidence of use of an optical lens from at least 68 AD we have:
In the writings of Pliny the Elder, we have a description of the use of what was either an emerald of another green gemstone that was classed as a smaragdus.
And then, besides, when viewed from a distance, these stones appear all the larger to the sight, reflecting as they do, their green hues upon the circumambient air...In form they are mostly concave, so as to re-unite the rays of light and the powers of vision: and hence it is, that it is so universally agreed upon among mankind to respect these stones, and to forbid their surface...When the surface of the smaragdus is flat, it reflects the image of objects in the same manner as a mirror.
We have apparently lost the original works where Aristotle published his vivisection and dissection notes from his work on the Island of Lesbos between leaving Plato's Academy (when he was passed over to head it after Plato's death in 348 BCE) and a couple of years later when he returned to Macedonia to act as Alexander the Great's tutor.
But, thankfully, the Arab scholars did not throw out the "Pagan" works of the Greeks. And in Ibn al-Haytham's work (965–1039 AD), we have what is said to be a copy of one of Aristotle's diagrams of the eye. It appears to show a lens.
I am not sure what animal this is from. But, we know that Aristotle noted a difference between mammalian eyes and those of cuttlefish. So, I would say it was almost certain that at this time is was known that the human eye contained a lens (even if no one admitted to human dissection).
I am also not certain that this is actually a copy of Aristotle's drawings. This may have been reported this way by those who wish to demonstrate that Arab cultures contributed nothing to science. So, this drawing may have dated from about 348 BCE or about 1400 years later... Reading the Arabic would help.
So, either this diagram predates Galen's 2nd Century AD work by a few centuries or it came a few centuries after... Sorry!
We certainly have established that knowledge by the time Leonardo makes his scandalous drawings of cadaver dissections.
The excellent answer above from CarlW about Galen is earlier than what I knew about from the Islamic Golden Age. Namely that Ibn al-Haytham (965–1039 AD) seems to have pulled this all together in his work. But, that isn't to say that the investigators in Europe in the Scientific Revolution didn't have to rediscover this on their own and came up with additional nuances and questions. (One of Newton's problems with the particle nature of corpuscles and light passing through lenses would not be answered until Quantum Mechanics-- as Feynman points out.)
There are a lot of "but they couldn't have understood optics" writers that comment on the early or ancient use of the lens. But, we humans have a tendency to believe that all who came before us were far more ignorant and unimaginative than our own enlightened generation.
The thinkers who wrote about optics in the Scientific Revolution, for example, were wealthy and far removed from the act of fishing for their dinner and preparing that fish. As a child, I fished with my father for dinner many times. And, while preparing it for dinner, he showed me how to extract the lens from a fish's eye. So, earlier thinkers had a ready-made example of how the lense should look (lentil-shaped and transparent) for them to copy and experiment with.
Hope this helps! Oh-- and don't forget-- the Greeks used Camera Obscura techniques to observe the eclipse. That's how Aristarchus estimated the distance from the Earth to the Sun.
A huge help in tracking down sources for my answer was this web page. After you search for a word in their database, there will be a place to the right of the page where you can limit the results by document where they are found-- so you can get closer to the time period you are interested in.
Probably the Swiss physician Felix Platter (1536 – 1614) that - according to Olivier Darrigol's A history of optics : From Greek antiquity to the nineteenth century, Oxford University Press (2012), page 23 - in his :
anatomic treatise of 1583 made the retina the sensor of the visual species, and the crystalline humor a magnifying glass (perspicillum). [...] Perspicillum was the Latin name then given to a growing popular device: the eyeglass.
See Felix Platter, De partium corporis humani structura eius et usu Libri III (Basel, 1603 ed), page 186.
Here's a very early bit of research. While it identifies the lens as critical to vision, it doesn't seem to recognize the lens as a focussing device From some classroom notes
In the second century A. D., Galen had at least two different theories of the eye to choose from. He chose the extramission theory because it corresponded well with his image of sight as a function of an optical pneuma, flowing forth from the brain to the eyes through hollow optic nerves. Galen defined many of the fundamental features of the anatomy and physiology of the eye until the seventeenth century. Benefiting from the work of the anatomists who dissected in Alexandria, such as Rufus of Ephesus, he described the retina, cornea, iris, uvea, tear ducts, and eyelids, as well as two fluids he called the vitreous and aqueous humors. He noted some of the peculiar features of sight such as binocular vision. Galen paid particular attention to the crystalline lens, which he described as a round lens in the middle of the eye. He concluded: "the crystalline lens is the principal instrument of vision, a fact clearly proved by what physicians call cataracts, which lie between the crystalline humor and the cornea and interfere with vision until they are couched.
This same page goes on to credit Platter as recognizing the lens as an imager (and more or less putting to be the concept of the optic nerve as an emitter).
Sushruta was a surgeon who developed cataract surgery and must have seen the human lens.
https://www.aao.org/senior-ophthalmologists/scope/article/sushrutaSushruta in 600 B.C. introduced extraocular expulsion of lens material.
Grzybowski A1, Ascaso FJ. Author information Abstract It is generally accepted that Jacques Daviel introduced in the 18th century the extracapsular technique of extraction of the lens while the couching method of cataract operation had already been practiced since ancient times. Present study analyses the first known cataract surgery description in three translations into English from the original Sanskrit Sushruta textbook and all the available literature on the subject. We found evidences that some sort of extraocular expulsion of lens material through a limbal puncture (paracentesis) was described by the Indian surgeon. Nevertheless, this incision cannot be considered as a classic extracapsular procedure because it was not large enough to allow the extraction of the entire lens. © 2013 The Authors. Acta Ophthalmologica © 2012 Acta Ophthalmologica Scandinavica Foundation.