The area of sharpness within your image is controlled by three distinct factors.
1 . aperture . 2. Focal length . 3 . distance from the subject.
Aperture : Changing the aperture, or F-stop number,is the most popular methods for controlling the depth of field. When a high aperture number like F32 or F22 is used , the image will contain a large depth of field – this means that objects in the foreground meddle ground and background all will appear sharp. If , instead , a low aperture number is selected for example ( F-1.8 or F-2.8 then only the small region of your image will remain sharp and the rest will become out of focus or blurred.
Focal length : The focal length of the lens that you photograph with also determines the extent of the depth of field in an image . The longer the focal length ( more than 50mm on a 35mm camera ) the smaller depth of field will be . the shorter the focal length ( less than 50mm on a 35mm camera) the greater depth of field effect .
Distance from the subject : The distance the camera is from the subject is also an important depth of field factor. Close up macro photos have very shallow DOF , whereas landscapes shots , where the main parts of the image are further away, have a greater DOF, in other words the closer you are to the subject , despite the aperture or lens you select , the shallower the DOF will be in the photograph.
Example of DOF effect.