If you focus a lens on a subject, only that subject is theoretically 'perfectly' in focus.  A black line painted on a white wall will be perfectly focused if the image projected on the back of your eye has no light striking on one area (the black part of the image), and the area immediately next to it will have white light striking it.  As you look at other distances closer, or further away, they are slightly out of focus.  Your eye's image will see black in one area, and white in another area, but there will be a blurry grey line between the two where the light goes from black to white.  However, if the degree of fuzziness (circle of confusion) around a subject is smaller than your eye's ability  to see (generally considered to be about 1 arc minute), your eye will think the subject is in focus.  There is therefore actually a distance in front of and behind your subject which will appear to be in focus.  Hence, 'perfect focus' for a lens is not really 1 precise theoretical distance, but a range, called your Depth of Field.  Note in the picture above, the focal point is on the word 'depth', however the lines above and below it are still in good focus.
 

Here are 3 different examples of focus.  In the middle is a point sized subject exactly at the lens' focal distance, and light from that subject is focused to a point on the back of your eye. 

The top image shows a point subject  which is closer than the lens' focal distance.  It wants to focus behind the film plane, as a result a fuzzy circle is formed on the film plane, not a point.

The bottom image shows a point source further away than the focal distance.  It focuses to a point in front of the film plane, then the light continues and de-focuses before it hits the film; again, forming a circle.

As long as the diameter of the circles in the top & bottom image are smaller than your eye can discern, all 3 will look like a point to your eye, and all 3 will appear in focus.  Once the circle gets big enough that your eye can tell it is not a point, it will appear out of focus.

Depth of Field (DOF) is the distance in front of and behind that subject which appears to be in focus.  This region is around 1/3 between you and the subject, and 2/3 behind the subject if you are focussed on something far away.  If you focus up close, the DoF ranges down to a small distance on the near side of your focal point, and a big distance beyond.  If you consider a rifle with a front sight 22" from your eye (eg an AR-15), and you focus at 45", your depth of field will be back as far as 22", and also forward to 600 yards, so it is less than 1 yaard on the near side to 600 yards on the far side.
 


The size of the depth of field for an object is driven by several factors, and I'll give the gory details below, but let me start by saying there are only 2 factors over which a target shooter has control when using a pinhole aperture as a lens: 

1.  The f-stop of the lens, or the size of the pinhole aperture you are looking through.  When shooting, you have two lenses to consider.  For the lens of your eye, the amount of light entering will cause the pupil to constrict or dilate.  More light entering will constrict the pupil, creating a smaller hole = higher f-stop, and improved depth of field.  You also have a second 'lens', which is the aperture in your rear sight.  As you use a smaller and smaller aperture, your depth of field will increase for similar reasons.  Ultimately, your depth of field is driven by a combination of these two f-stops.  You improve your DoF and focus by using a smaller aperture in your sight, but eventually you get to the point where you reduce the amount of light getting to your eye, your image becomes dim, your pupil dilates, and your eye starts losing depth of field.  Talk to any shooter who uses a match rifle with an adjustable rear aperture.  They will tell you that you reduce the aperture and see your depth of field improving, then you get to a point where the image starts going dark, that's where you stop.


2.  Your focused distance.  As you focus further away, your depth of field increases.  Ideally for a shooter, you want to focus at a distance between your front sight and your target.  Since you typically have a small amount of your depth of field between you and the point of perfect focus, and a larger amount of your depth of field behind that point, you want to focus at a distance closer to your front sight than the target.  If your depth of field is great enough, you can have the far edge of your depth of field keeping the target in focus at the same time as the near end of your depth of field can see the front sight.  Unfortunately, this is not easy to do.  Your eye likes to focus on an object, not at some arbitrary distance in space.  This is why shooters are taught to focus on the front sight.  It takes mental focus (no pun intended!) to drive your eye to a focal distance between the front sight and the target, so both are in your depth of field, and appear in focus at the same time.  Based on the math below, that perfect distance is about 2x the distance to your front sight.

OK, so here's the gory Depth of Field formula:

The near and far distance values of depth of field are 

d1, d2 = s/[1 ± ac(s-f)/f2] 

Where: 

d1 and d2 — denote the minimum or maximum distance in acceptable focus
s — the perfect focused distance 
f — lens focal length 
a — aperture (or f-stop), which is the ratio of the lens focal length to its diameter. 
c — the diameter of the acceptable circle of confusion, or the width of the smallest fuzzy line your eye can see. 
In other words, if your camera/eye is focused at s, focus will be achieved for subjects ranging in distance from d1 to d2. 

All lengths must be in the same units. 

The value of c is typically based on the fact that an eye can see 0.1mm at 25cm (10 inches), or just under 1.5 arc-minutes.  If you project 1.5 arc -minutes onto the back of an eyeball, you end up with an allowable circle of confusion of 0.01mm (make the math easy - assume an eyeball is 1 inch in diameter.  If you can see 0.1 mm resolution at 10 inches, this projects to 0.01mm at 1 inch on the back of your eyeball).

Negative results for the far limit mean your Depth of Field reaches past infinity. (as in, To Infinity, and Beyond!).  Cute, but there is a critical lesson here.  You are trying to distribute your depth of field evenly between your target and your front sight.  If you focus on your target, you will have 1/3 of your depth of field in front of your target which is in focus, and 2/3 of your depth of field beyond your target which is ... wasted.  Similarly, if you focus on your front sight, you will have 2/3 of your depth of field beyond your front sight, but you will have 1/3 of your depth of field between your eye and your front sight which is wasted.  For camera lenses, there is a concept called a hyperfocal distance, where the far edge of the depth of field just barely touches infinity.  Thus, everything from infinity, back to the near edge of your depth of field, is in focus.  If you are lucky, and have sufficient depth of field, and can train you eye to focus at this distance, you will have focus from the front sight to the target, all at once.