Why does looking through pinhole change the eyes focal length? Normally the comfortable viewing distance for small text on my phone is around 20 to 30cm much below that and details start to get fuzzy. However looking through a pinhole (hole punctured in a thick sheet of paper) I can bring the phone as close as 5cm! Does this effect have a name and explanation along with matching equations to calculate the modified focal lengths for various distances and aperture sizes?
 A: This effect is called Depth Of Field. It does not change the focal distance of your eyes, only makes the image less blurry. The main idea is that the smaller the aperture (pinhole), the less blurry out of focus images are. The pinhole does not bring your text into focus. The text is still out of focus. However the pinhole increases the Depth Of Field (at the expense of intensity) thus increasing the image sharpness. The smaller the hole, the dimmer, but sharper the image is, until you hit the diffraction limit and then the effect reverses. So there is an optimal aperture for the best sharpness, a trade-off between the Depth Of Field and diffraction. You can find the formula and tons of information in the linked Wikipedia article.
A: Picture a convex lens with the focal point about two inches behind the lens. Notice how light that enters the lens near the edge must bend more than light that enters near the center. In fact, light that enters at the exact center does not bend at all. The rays that are bent more are more subject to error especially as we age. When we mask off the outer area with a pin hole or a small hole created by our fingers. We are removing the distorted waves from the edge of the lens. This allows us to then view only the clean rays that are passing through the center portion, the rays that bend only a small amount. Masking the edge does not increase the focal length, but it does change the ratio between the lens diameter and the focal length. This can increase depth of field and increase contrast.
A: Maybe you are not aware of the pinhole effect, long before lenses were invented  one knew the optics of a pinhole forming an image. 


Pinhole cameras are an ancient technology. They were known by the Chinese since 500 BCE. Arabic astronomer Ibn al-Haytham first used one to view an eclipses around 1000 CE. The first modern cameras were also based upon pinhole cameras. They aren't used as much today because of a major drawback. The sharpness of your image depends upon the size of your pinhole. The smaller the hole, the sharper the image. But a smaller hole also means the image is more dim. For everyday images this means a camera would need a long exposure time to get a decent image. 

So imagine how long one should look in order to register an image on our retina.That was why lenses were invented by nature, to start with , so as to concentrate the light on the focal plane.
Here is another site , and a picture taken with a pinhole camera:

