In addition to new lenses, there are thousands of secondhand lenses, some decades old, available from camera shops and websites such as eBay. But don't assume that because a lens is the same brand as your camera that it will fit. Even if it does it may be with a loss of functions such as aperture control and auto exposure. Also, it's worth just mentioning that older, manual focus lenses won't become auto focus on a DSLR because they lack the required electronics.
Image quality with some older lenses may not be as good either, because they were designed for film, not digital sensors.
On the other hand, many old lenses provide cracking quality at a bargain price. The only way to find out is to do some tests. Visit photography forums to see if others have had experience of a particular old lens before buying. Here's a rough guide to what will fit each mount.
All EF and EF-S lenses from the EOS system, which goes back to 1987, will fit any current Canon DSLR, though EF-S lenses cannot be used on Canon's full-frame DSLRs. This means that lenses from Canon's 35mm EOS SLRs can be used. Prior to 1987 Canon used the mechanical FD lens mount, which is not compatible with current DSLRs.
Most Nikon lenses going back to the 1950s will physically fit current Nikon DSLRs, though non-AI lenses made prior to 1977 will need to be modified first. Of course, old manual focus lenses lack the electronic contacts used in new lenses so you'll only be able to use them in Aperture Priority or Manual exposure modes.
The Pentax K (or ‘PK') mount was born in 1975 and all lenses since then fit all current Pentax or Samsung DSLRs, though only lenses with an ‘A' position on the aperture ring will provide full stop-down metering. Lenses without this can still be used in Manual Exposure mode, and by using the AE-Lock button to take a meter reading.
Sony bought Konica Minolta's DSLR camera business in 2006 and re-launched it as the Alpha system. Many of Sony's Alpha lenses are simply re-badged Minolta lenses, which means that any Minolta AF lens produced since the launch of Minolta's Dynax camera system in 1985 will fit any Alpha DSLR and provide full functionality.
Born in 2003, Four-Thirds is the newest DSLR mount, so has the smallest lens range. Olympus is currently the only producer of DSLRs in this mount but with the MF1 adaptor lenses in the company's previous OM system, launched in 1972, can be fitted, although they only function in Aperture Priority or Manual exposure modes.
Micro Four Thirds:
The younger, smaller brother of Four-Thirds launched in 2008. Although MFT cameras use four-thirds sensors, the smaller bodies mean MFT lenses can be smaller. There are only a handful of MFT lenses at present; however, both the full range of Four-Thirds lenses and Olympus OM system lenses, as well as a few others, can be fitted to MFT cameras using the appropriate adaptor.