When the eye is looking at a distant object, then the eye is in the relaxed state and the eye lens is very thin (or less convex) in this position. Since the eye lens is very thin, its focal length increases.
But in the case of looking near by objects, the ciliary muscles get stretched due to which the eye lens become thick (or more convex ) and hence its focal length decreases.