In Nikon F-mount manual-focus lenses, there are four main designations for lenses that refer to their meter coupling abilities. They are: Non-AI, AI, AI-S, and AI'd. The differences can be noticed by visually inspecting the area on the back of the lens around the lens mount, as well as around the aperture ring. Below, we will be explaining the differences in these lenses and how to tell them apart by looking at them.
Non-AI lens. Notice there are no recessed areas on this lens like on the others below, or any holes in the metering prongs.
In 1959 Nikon began making lenses that at the time were called “Nikon F lenses”. It was not until 1977 when Nikon came out with AI lenses that the earlier models were called “Non-AI”. Non-AI Nikon lenses have a very basic bayonet mount. The most distinctive characteristics of the Non-AI lenses are the metering prong without “nostrils” (2 smaller holes on either side of the opening) and the plain stainless steel base with 5 mounting screws. These lenses also show only one row of aperture numbers rather that having a larger set and smaller set next to each other. Non-AI lenses fit on the Nikon F Photomic FTN, early F2, Nikkormat FT, FTN, FT2, EL and ELW. They can be used without meter coupling on the earliest AI camera bodies such as the FM and FE, but they should not be mounted on later ones such as the FM2, as it is possible to damage the camera body.
AI lens. The red on the right shows the areas that are recessed on the edge of the aperture ring around the mount. Also notice the holes in the metering prongs.
In 1977 Nikon introduced the AI lens which was short for Automatic Maximum Aperture Indexing. This was a new system for coupling the lens to the camera's exposure system. These lenses were much faster and easier to mount and release because the “AI ridge” automatically meter-couples when the lens is mounted. AI lenses can be recognized by the double row of large and small aperture numbers engraved on the aperture ring. The smaller set of aperture numbers were designated for the Aperture Direct Readout (ADR) located on the body or prism to show you which aperture you were using through the viewfinder. The E series AI lenses (for Nikon EM) were the first auto lenses to remove the meter coupling prong from its design. AI lenses work on manual focus bodies produced after 1977, as well as all but the low end auto-focus digital SLR's (although they won't auto-focus on an AF body since they are still manual lenses).
AI'd lens. The red shows the area that has been modified and is recessed on the aperture ring.
Some lenses are known as “AI'd”. These were Non-AI lenses that were converted to AI by exchanging the aperture ring at the rear of the lens. This modification was either done from a Nikon kit that was available, a repair shop, or some people chose the make the modification themselves by Dremeling out a space around the mount/aperture ring. This modification allowed the old lenses to be used on the new cameras at the time. A good way to tell the difference is to see if the glass is multi-coated. If not, then you most likely have an AI'd lens.
AI'd lens. Often a sticker will be added so that the lens will have the second row of aperture numbers.
In 1981, Nikon Introduced the AI-S (Automatic Aperture Indexing Shutter) lens. A quick way to tell if a lens is AI-S is by the (Lens Type Signal) notch carved out of the metal bayonet ring. The AI-S lenses had standardized aperture control and a Focal Length Indexing Ridge. Because of these two features, these lenses were best suited for use on cameras with shutter priority and other auto-aperture exposure modes, such as the FG, FA, N2000,  N2020, N8008, and the F4. Later cameras did not require these two features and worked with both AI and AI-S lenses.
AI-S lens. The red shows the areas that are recessed on the aperture ring and the notch in the mount.
Comparing the aperture rings of an AI or AI-S lens (left) with one of a Non-AI lens (right). Non-AI lenses have one aperture scale, while the AI and AI-S lenses have a double scale. 
 - Mollie Clark