How to see it?
You may find Lens model description in the image metadata with an Exif viewer that is able to translate the MakerNotes section of the metadata. I use either my RAW-converter software or an online viewer - Jeffrey's exif viewer at Regex.info. Google can find several Exif viewers for you, but not all of them read and/or translate MakerNotes.
Is it there?
Chances to find correct lens info from metadata are good when the camera and lens are both from the same manufacturer. However, third party lenses may show up with invalid or missing lens model info. Also the use of a teleconverter, extension tube or adapter ring may lead to incorrect or missing Lens model info. What more, many photo gallery sites, and for example Facebook, intentionally strip most or all Exif info (and the rest of metadata) off the images.
How is it done?
Lens is recognized by the camera only if its ID-code is known to it. Camera makers include information of several lenses in the firmware, but if a certain lens you use is not included, then the camera can not recognize it correctly.
Some basic specs of a lens is transferred from lens to camera (for example focal length and the maximum usable aperture at current zoom level) and those are then included in EXIF data. Lens model info is not included in the basic EXIF-data but is found in MakerNotes section instead.
Each lens has its own ID-code which is sent to the camera body when an image is captured. Camera body firmware has a lookup table for these ID-codes. A code that is found in the lookup table is translated into uniform (per camera manufacturer) code and gets written into MakerNotes section of metadata of the image. It is up to the EXIF reader software to interpret the lens model code into a lens model description. Base line is, correct info can only be found if the info is already known by the camera.
Two examples:
For example my Sony A37 does not quite recognize my telezoom lens:
Lens Model 75-300mm F4.5-5.6
Max aperture F4.0
Almost correct but not quite there. See how the lens is first recognized as f/4.5-5.6 but then maximum aperture is a hard fact transferred from lens to camera as f/4.0 (which is true). The lens is actually a Sigma 70-300 f/4-5.6 DG so even the focal range was wrong in EXIF. What happened here is that the ID-code sent by the lens falls into slot 25611 of the lookup table. That number is reserved for "Minolta AF 75-300mm F4.5-5.6 or Sigma Lens". An EXIF reader that I use then shows this as simply "75-300mm F4.5-5.6" in Lens Model field.
A lens that is recognized by my camera has exact info:
Lens Model DT 18-55mm F3.5-5.6 SAM
Max aperture F4.0
The lens is Sony's own model, a Sony DT 18-55 f/3.5-5.6 SAM and so quite naturally included in the camera's firmware. The max aperture is f/4.0 because in this case the lens was zoomed in a bit, which has an effect on the max possible aperture.
Updating your camera's firmware may increase the number of lenses your camera can recognize, but it is up to the EXIF reader software to show the lens description instead of just a code in MakerNotes.