It would depend on the aperture and associated depth of field (DOF). The smaller the aperture (larger f-stop number) the larger the depth of field. The DOF will also be affected by the lens focal length. So depending on the focal length and aperture you can have a DOF which would range up to infinity but still have closer objects in focus as well. Some people will also focus to a hyperfocal distance - which is basically the focal distance which gives the largest DOF from close up to infinity. Lots of reading and opinions on hyperfocal distance usage.

But the short answer is to just check a DOF calculator and input your lens and aperture, etc to find the DOF and subject distance which gives focus to infinity.

Stephen