I was asked a few days ago about depth of field and how to control it. When we talk about depth of field, we're talking about how much foreground-to-background distance appears to be in good focus. Rather than go into a big technical explanation, I thought I'd offer up this a quick discussion of the three factors that contribute most to depth of field.
First is aperture. The larger the lens opening (i.e., aperture), the shallower the depth of field. This can be a little confusing to less-seasoned photographers because the change in size of the aperture opening runs contrary to the magnitude of the f-stop number. So, f/16 has a smaller lens opening than, say, f/2.8. Rather than think of the f-stop's inverse relationship to lens opening, it's a lot easier to just associate f-stop with depth of field. Smaller f-stops equate to smaller, or shallower, depths of field.
The second factor is the length of the lens you're using. For any given aperture, the depth of field will be shallower with longer (i.e., telephoto) lenses versus shorter (i.e., wide-angle) lenses. Just to expand on that, if I photographed two scenes at an aperture setting of f/5.6, the scene shot with the longest lens would have the shallowest depth of field. For this reason, if your goal is to create an image with a blurry-looking background, but sharp subject, you'd choose to photograph with a telephoto lens. If your goal is to create an image where virtually everything in the photograph is in focus, you'd choose a wide-angle lens.
Finally, the distance between your subject and the camera is the third factor contributing to depth of field. The closer subjects are to the camera, the shallower the depth of field is going to be. So, using the same lens length and aperture, your pictures will have more depth of field (i.e., more things in focus) when your subject is further away from the camera and shallower depth of field when they are close to the camera.
Hope that sheds a more light on any lingering mysteries surrounding depth of field. And, I hope it helps you exert greater control over the creative look of your photography. Happy shooting!