Your lens is quite possibly the most important part of your camera. SLR and dSLR (digital SLR) cameras (and even some non SLR/dSLR) allow you to change out the lenses, to suit all of your photography needs. A good lens will produce sharp crystal-clear pictures with beautiful detail. A low quality lens can hinder you to the point where you'd be better off shooting with a disposable camera. Basically, your lens makes or breaks your camera. Different lenses have different purposes, functions, and features. Sure, you can spend a thousand plus dollars on a top of the line lens, but do you really need a lens that advanced for the photography that you do?
One important thing to remember when selecting a lens for a digital camera with an APS-C sensor (the majority of digital SLRs on the market), is that a lens used on a digital camera will have an effectively longer focal length than if it was used on a film camera. This comes in handy when buying telephoto lenses, but can be a hinderance when purchasing wide-angle lenses. For example, a 24mm lens on an APS-C sensor digital SLR would have around the same focal length as a 38mm lens on a film camera, a 300mm lens used on an APS-C digital camera would be the equivalent of around a 480mm lens used on a film camera. However, wide angle lenses made for digital SLRs generally go down to a lower focal length than those made for film cameras to compensate for this.
Different lenses have different uses. If you were photographing a subject 10 inches away, you would most definitely use a different lens than if you were photographing a subject 200 feet away. There are 'All Around' lenses available, which will allow you to take both wide-angle shots and extreme telephoto shots, but usually you don't get a high quality all around lens unless you are willing to spend a good deal of money. Not to mention, all around lenses are generally pretty bulky. Do you really want that bulk if you are taking pictures of subjects close to you, and don't need it? This is not true in all cases, especially lenses which zoom from wide-angle to a focal length in the shorter end of the telephoto focal lengths, but for a true all around, expect to pay a pretty large amount.
All lenses come in two varieties, Zoom and Prime. Zoom lenses allow you to zoom between a smaller and larger focal point. This can be zooming between a wide angle focal length and a telephoto focal length, a telephoto focal length and longer telephoto focal length, etc. Basically, a zoom lens is any lens that allows you to zoom between 2 focal lengths. Prime lenses are lenses which have a fixed focal length. For example, a 200mm prime lens would only be able to shoot at 200mm. There is no zooming whatsoever.
Wide - A wide angle lens is a lens which has a shorter focal length than that of a 'standard' lens, allowing a much wider area to be brought into frame. To obtain a wider view, the center lens has to be closer to the sensor (or film if you are using a film camera) of your camera, which means the lens must be shorter in overall length. A lens with a lower focal length (in millimeters) is always wider angle than a lens with a higher focal length. For example, an 18mm focal length is wider angle than a 55mm focal length. Wide angle lenses for digital cameras typically range from about 8mm to 35mm.
Standard - A standard lens is one which is in between wide angle and telephoto. Standard lenses for digital cameras typically range from about 35mm to 80mm.
Telephoto - A telephoto lens allows you to zoom in on far away subjects. The telephoto range is the widest range of focal lengths, ranging from under a hundred to over a thousand millimeters. These lenses are also the longest and bulkiest of all lenses, and it is not uncommon for a telephoto lens to weigh a pound or more. Telephoto lenses for digital cameras typically range from 80mm to 1200mm or more.
Fisheye - A fisheye lens is an extremely wide angle lens which captures at least a 180 degree field of view, and takes distorted pictures which bulge outwards in the middle, similar to a fish eye. Fisheye lenses were originally developed for use in meteorology and astronomy, but became popular with photographers for the unique images that they produce.
Macro - A macro lens is a lens of any focal length (but typically standard or short telephoto) which allows an extremely close minimum focusing distance to the subject. True macro lenses also feature a 1:1 (life size) reproduction ratio. Macro lenses are used for extreme close-up photography.
Zoom - A zoom lens is a lens which allows zooming between multiple focal lengths. This can be between any combination of focal lengths, such as wide to normal, wide to telephoto, normal to telephoto, etc.
Prime - A prime lens is a lens with a fixed focal length, which allows for no zoom or adjustment of focal length. Many macro lenses are prime lenses.
Focal length example, 18mm-300mm
What type of lens should I buy?
What type of lens you buy depends entirely on your photography habits. Your camera probably came with a wide to standard 'kit lens', but if it didn't, you may want to consider getting one of these first. Since they come with many cameras, you can usually find them pretty cheap (between $100 and $200). A good lens in this category would be an 18-55mm camera lens. For example, the Canon Rebel XT kit lens is a 18-55mm f/3.5-5.6, and is a decent all-around lens (excluding telephoto). After you have a wide to standard lens for your general picture taking, you may want to consider a 'fast' lens (lens with a large maximum aperture) which would be good for taking photos in low-light situations with no flash, and also good for creating that beautiful background blur that we all love (called 'bokeh'). A good lens to consider for this would be a 50mm f/1.8 camera lens. One excellent (and extremely low priced) choice in particular is the Canon 50mm f/1.8. You can find these for well under $100 new, and they are definitely worth three times that price. As far as taking long-range pictures, or merely bringing a subject closer, you may want to consider a short to long telephoto zoom lens. Something like a 70-300mm telephoto zoom lens would be a good idea. These three lens choices would be an excellent setup, until you wanted to get into the more advanced (and specific) lenses such as macros, fisheyes, etc.
Personally, the first 3 lenses in my kit were:
Canon EF-S 18-55mm f/3.5-5.6 USM SLR Lens - $144.95 (came with my camera)
Canon EF 50mm f/1.8 II Camera Lens - $79.95
Sigma 70-300mm f/4-5.6 DG APO Macro Telephoto Zoom Lens - $204.52
A fully functional, all-purpose, decent quality lens collection for $430. You can't beat that.
Lens Enhancements and Add-Ons
There are several products which you can purchase to enhance the functionality of your current lenses. I will outline some of these for you and explain what they do.
Lens Filters - Lens filters can help enhance skies, remove reflections, cut through haze, and do a plethora of other things. For details on lens filters, see Lens Filters Explained.
Extension Tubes - Extension tubes are simple plastic tubes which fit between the body of your camera and your lens. By increasing the distance of the front element to the body, it allows your lens to focus closer. From adding this extension in, you are effectively increasing the focal length (giving you more magnification) and also decreasing the minimum focusing distance. For this reason, extension tubes are a great method of extending the macro capabilities of a non-macro lens. With an extension tube, you are able to frame the subject larger and capture more detail. Downsides of extension tubes are that they increase the bulk and length of your lens and you lose the ability to focus to infinity.
Diopters - Diopters are basically magnifying lenses that mount onto the front of your lens like a filter. They allow you to get closer to your subject, but cheap diopters will distort the edges of your image.
Reversing Rings - Reversing rings completely flip your lens around and mount it backwards on the body. This allows you to get drastically closer to your subject, but only work well with film lenses, as you must manually stop down the aperture.
Teleconverters - Teleconverters will multiply the magnification of your lens (generally by 2x or 3x) therefore giving you the effect of a lens with double or triple the focal length. With a 70-300mm lens and a 3x teleconverter, that lens instantly becomes 210-900mm.
Camera Settings Explained
Lens Filters Explained