The camera is one part of the DSLR equation, and the lens is the other. Here's the basics that you need to know before lens shopping.
Lens Mount Types
The lens mount is the attachment standard between a lens itself and the camera body. As a rough guide, the camera itself determines the compatible lens types, although with a little adaptor work it's not impossible to get "competing" lenses working on alternate camera brands. Doing so may disable some features such as auto focus, however.
Each camera manufacturer uses their own proprietary mounting system, and matters get more complex when you step down to smaller ILC type cameras, but as an example, Nikon DSLRs use Nikon's F mount system, first used in a film DSLR back in 1959 and as such the oldest film mount system still in production. Canon switched from its FD mount system first produced in 1971 to the EF ("Electro-Focus") lens system that its current EOS model cameras use.
Sony's current A-Mount lens system builds on the Minolta AF lens mount system, because Sony purchased Konica Minolta's photography business back in 2006. What's the practical application of all of this? If you're buying first party DSLR lenses compatibility can be easily assumed, although there is a wrinkle there as many first party camera makers also produce smaller mirrorless bodies with matching smaller lens types that often carry much of the same branding.
Where it's vital to check compatibility is if you're buying third party lenses. If you're buying from a cheaper third party lens provider (Tamron being an obvious example) then explicitly checking mount compatibility will save you pain, as many lenses are made with different end mount points.
Prime Versus Zoom
The other choice to make with lenses is whether to opt for a zoom or what's called a "prime" lens.
Zoom lenses, as the name suggests, include an adjustable zoom lens for shifting focus closer to objects that are further away, with more expensive zoom lenses ramping up both the magnification factor and image stabilisation as increased levels of zoom greatly increase issues with camera shake. Typically speaking a zoom lens will offer you more straight flexibility because you can play around with precise framing and distance from shots, and rather obviously you can get in close to action that may be impractical or impossible to get close to. Prime lenses have a fixed focal length, and that can be challenging from a framing perspective, but they too have their advantages.
Typically within the same price range a fixed focus lens will be faster — that is, they have wider apertures — than their equivalent zoom counterparts — and they're often (but not exclusively) sharper than their zoom counterparts. As always, there's a balance here between skill, desire and the situation at hand. There's a certain challenge in using a fixed focus lens that can bring out new aspects of your photography.
Manual Focus Versus Auto-Focus
It might seem obvious that if you can autofocus you should, because it leaves other aspects of photography to you while getting pin-sharp photos. The reality is more complex. While most lenses will offer automatic focus options, it's not always your best friend when it comes to getting the best possible shot, because the camera itself has to make a "best case" guess as to what it is you want to focus on.
You can adjust this depending on your chosen focus pattern to an extent, but you're still handing over the sharpness (or lack thereof) in your photos directly to your camera. That being said, careful and exact manual focus does take some work to get right. It can be essential for certain types of photography, such as macro-level work or in certain low-light situations. It's a skill worth learning, because sometimes you'll find your autofocus struggling, or click only to find that the subject is blurred and that tree in the background is all you have as a sharp shot.
Just as there are general photography accessories to cover every eventuality, there are lenses to cover some terribly specific situations that may be desirable. Bear in mind that properly cared for lenses can last for decades, and as such they'll outlive your camera body, so a smart investment in good glass can really pay off. Here's some other features to consider when buying lenses:
Weatherproofing: Planning lots of outdoor shots, or shoots in hostile weather environments? Weatherproof lenses will cost a little more, but they beat a flooded and ruined lens every time.
Collapsible: The problem with taking lots of lenses with you is that glass is both heavy and bulky. A collapsible lens allows you to stow more lenses in your storage space while still offering flexibility, although they're typically not as good as a full sized lens.
Optical Image Stabilisation: Camera shake is the enemy of sharp pictures, which means that some form of compensation is neccessary. This goes by various names — Nikon calls it Vibration Reduction, while Canon talks of Image Stabilisation , and some use "Optical Stabilisation" instead. The end result is the same, however. Depending on your camera body there may be some image stabilisation at the sensor level, but many lenses, especially those for Canon or Nikon DSLRs offer stabilisation in the lens body itself. The biggest downside here is that an OIS lens is a more expensive lens to buy in the first place.