When a probe approaches a small body like a comet or asteroid, they only get a chance to take a few high-res pictures, because what they make are mosaics. That means that the pictures are actually stitched together from tens of smaller pictures. After a few of these, the perspective and distance will have changed so much, that they can no longer stitch the images together seamlessly. If they inaccurately estimate the relative position of the object to the spacecraft, they may not get the frame they wanted. So they have to either do the math right, or they have to have instruments on board so the probe can decide what the perfect frame is.
The speed of taking a single images varies wildly. It all depends on how dim the object is and how big the imaging sensor is. If the objects is bright, it takes only a fraction of a second to gather enough photons for a usable image. On the other hand, the Hubble space telescope can take weeks to picture distant galaxies.
The next limit is the transmission speed. The probe has some internal storage, but eventually it will have to phone home to unload the scientific paydirt. If it is close to earth, that can happen as fast as it can take pictures. If it is in outer space, it can take a very long. The Voyager probes transmit signals at only 160 bits per second.
So if a probe flies by an object quickly, or is very far from earth, it needs to be picky.
Orbiting probes have more time for transmission, but here also, pictures are often carefully planned in order to get the most out of the probe's lifetime.
I thought that the HRSC instrument on the Mars Express orbiter scanned the Martian surface continually in a line underneath the orbiter, but I was unable to find a source to back this up. Maybe I misremembered. In any case, it pictured more than 60% of the Martian surface, you can't say it's very selective about what it wants to see.
Rovers like Curiosity have an array of cameras on board. Some take a continuous video stream for navigation, others take mosaic pictures as described above. The picturing time can be anywhere from instantaneous to seconds. Curiosity once took 12 seconds to take a picture of nearby Ceres and Vesta. Pictures like this are "made to order", but Curiosity also carries artificial intelligence to decide if anything in its surroundings is "out of place" and needs investigating.