Telescopes and any other optics that look at objects in space are set so that the focus is at infinity as defined by the equations of optics.
Resolving power has to do with the size of the primary mirror and the wavelength of light that you are interested in. The smaller the mirror, the less angular size you can resolve (so you can only separate two objects that are far apart). The bigger the mirror, the closer two objects can be and you can see them as separate features. Similarly with wavelength, the longer (redder) the wavelength of light that you're interested in, the bigger the mirror you need, whereas the shorter (bluer) the wavelength, the smaller the mirror can be. This is known as the diffraction limit.
But there's another factor to consider, and that's the resolution of the actual detector. Let's say that your diffraction limit for 500 nm light (green) on a 2.4 m mirror (Hubble) is roughly 0.05 arcseconds. But, if your detector only records 1.00 arcseconds per pixel, then that is your limit. Usually detectors are designed to be at or a little better than the diffraction limit of the optics, though.
In terms of time needed, that has to do with how bright the object is per angular unit. For example, the Andromeda galaxy is very bright as a whole, but that brightness is spread over a large portion of the sky. So the brighter the object is and the more concentrated that light source is, the shorter time is needed to properly photograph it. And this also has to do with the "speed" of your optics -- a larger f/number is "slower" and requires more exposure time than a smaller f/number.
But every detector is different in terms of how sensitive it is and how long you actually need to record the same amount of light. This gets into issues of quantum efficiency that I think are beyond your question. Suffice to say, there is no set equation to know how long you need to expose an object to properly capture it.