The basic idea in taking a photo is to catch the right amount of light. The amount of light which reaches the sensor of our camera is called exposure. Too much light and the shot will be overexposed, too little and it will be very dark- in both cases without much detail, tonal range or nice colors. Obviously choosing given camera technology (negative/slide/B&W film, digicam or digital SLR) will change the error margin here but the basic idea is always the same.
There are three basic settings that determine exposure:
It's basically as simple as this -- by changing the above settings you can influence the final exposure. From the point of view of exposure, these settings are equal and it doesn't matter if you increase e.g. ISO or exposure time. Both will result in more light reaching the sensor. As for a practical example, if on a sunny day we take a few pictures outside, and then we go inside a building, we must adapt to much less available light. We do this by changing one or more of the above settings: either increase the aperture (opening), or increase the exposure time, or increase the ISO sensitivity.
For any given lighting conditions, if for some reason (more about it in a second) you want to increase one of the parameters, you must decrease one or both other parameters accordingly. Otherwise too much light will get into the camera. Since all cameras have a built-in light meter that knows how to set the tree settings to get proper exposure, taking a picture for most people is as simple as pressing the shutter release button. The computer inside does the rest.
Now, here's where the things get exciting: the three parameters also have "side effects" -- they not only control the exposure, but also other factors very important in getting a good photo. And here's where our computer inside the camera no longer can help. Just as it's up to the photographer to choose the right point of view and composition, it should be also up to his/her vision to determine the other factors that create the final picture. Otherwise we leave this up to the computer that has absolutely no clue about our artistic vision. Here are some specifics:
Aperture is closely connected to depth of field (DOF). Depth of field is the distance in front of and behind the object in focus, within which all objects will be sharp. Now, if we make the aperture smaller, other than letting less light into the sensor, the depth of field gets also wider. This means that for small apertures almost everything in the photo will be sharp, whether it's far away or close to the camera. Increasing the aperture will in turn make everything behind or in front of our focus point unsharp and blurry. This is great for portraits where we don't want the background to be distracting.
LARGE apertures are quite strangly expressed by SMALL numbers (called F-numbers). For example taking a picture at F1.4 will have such a narrow DOF that even the ears of a person can be blurry if we focus on a person's nose (which is a bit closer to the camera). On the other hand, the aperture of F22 will let us take a picture of a person standing just in front of the camera and of the Grand Canyon far behind and everything will stay sharp.
The scale here may look quite odd, for example going from F1.4 to F2 and from F11 to F16 both mean letting in twice less light. Estimating which F-number to use to get desired depth of field comes with experience and depends on too many factors to try calculating it. Fortunately in the digital era we can take a shot, then check the result on the screen and possibly try again with another setting. An old recipe for a good photo says "F8 and be there". This is not to be taken seriously but F8 is usually a good starting point for photos of people, buildings or objects we might want to take on a walk. The background far away will be a bit blurry but still many things around the main object will stay sharp.
The "side effects" of this setting are much greater for photos where there is any kind of movement. A short exposure time will freeze all motion and a long one will allow taking pictures with dramatic effects or ones that tell a story with the captured movement. There is also an often undesired effect of long exposure times which is camera shake if we don't use a tripod. This is probably the single factor that ruins the largest number of photos taken if we don't pay attention to this.
There is a general rule that can be followed to know which exposure times will be too long for hand-held shots. But first we'll need to look at the idea of focal length. Even though the focal length is expressed in milimeters (it's the numbers you see on any zoom lens, e.g. 18 35 50 85...), it is better understood as the angle at which the camera looks at the world. Small or short focal lengths (e.g. 18mm or 28mm) are called wide-angle and make everything smaller than in reality because they "squeeze" objects seen at a wide range of angles into the frame. Long focal lengths are called telephoto (e.g. 135mm or 200mm) and they work like binoculars -- a very small angle at which the lens looks out at the world magnifies the objects seen, such as a small bird far away that can take up the whole frame.
Getting back to the problem of camera shake, the longest exposure time you can afford if you have relatively steady hands is 1 divided by the focal length -- in seconds. For example, if we set our zoom lens to the focal length of 50mm, we must stay under 1/50 sec to avoid blur caused by camera shake. In the telephoto range of e.g. 300mm we must take care not to exceed 1/300 sec, etc.
In the film days once we loaded a film into the camera we were stuck with a single ISO setting. Now we can change this from shot to shot. This is a great setting to have control over. If we want to carefully set exposure time and/or aperture to get a desired effect in the photo, we simply have to adjust the ISO! Unfortunately here too, there's no such thing as a free lunch. By increasing the ISO level (needed for low-light / small aperture / short exposure time situations) we also increase the noise -- it can be seen especially in the dark areas as lots of small color speckles instead of a solid color.
Naturally all three settings have their limits. In most digitals SLRs, ISO can be set between 100 and 3200, exposure time cannot be shorter than 1/8000s and possible aperture settings depend on the lens used (good quality zooms may be limited by something like F2.8 and F32). Extreme lighting conditions such as very bright days or night will often limit us to an extreme value for one or even all of the three settings. As an example, many photographers like to take photos in the city at night without a tripod and this might be only possible at ISO 3200 and F2.8 if we want to avoid camera shake.
As mentioned earlier, all cameras have a built-in light meter that can either tell us whether our photo will be correctly / under- / over-exposed when we use given values of the three settings. Even better, the camera can let us choose two of the settings and set the third one automatically for us to ensure correct exposure. This second functionality of the light meter is in most cases not at all limiting but instead allows us to quickly take a photo while still leaving it up to us to use a specific aperture or exposure time. This choice is controlled by the shooting mode, usually quickly adjustable from shot to shot.
Virtually all cameras offer the following shooting modes, on top of one or more automatic modes (and we do want to avoid those at all cost!):
S or T or Tv (time-priority) -- in this mode it's up to you to set the desired exposure time and ISO. The aperture will be calculated by the camera and displayed in the viewfinder / screen prior to taking the shot to let you apply changes if necessary. This mode is often used for sports photography or special effects (e.g. star trails).
A (aperture-priority) - in this mode you set the ISO and aperture and the camera will choose exposure time. Many photographers use this mode as their favorite, since you can easily control what you want to have in focus and you must only increase the ISO if the exposure time calculated by the camera is too long and introduces the risk of camera shake.
M (manual) - in this mode you control all three parameters and the camera tells you if it thinks the shot will be underexposed, overexposed or exposed correctly. This mode gives complete control over every aspect of the photo (including exposure) but is slow to use, therefore inapropriate if we need to act fast.
P (program) -- this mode is almost a fully automatic mode. You only choose the ISO and the other two settings are presented to you in pairs. Your adjustments cause a change of the aperture / exposure time pair at the same time without any preference of one setting over the other.
One thing that is worth mentioning is that the light meter itself also makes mistakes -- or rather incorrect guesses. If we have a scene with both very bright and dark areas, we must partially either overexpose or underexpose the scene -- there is no possibility to capture details in all parts. Modern cameras have sophisticated algorithms that make this decision for us but sometimes it may not be what you expect. In such cases you can either use the M mode where you have full control over every parameter, or you can use a control called exposure compensation, available in practically all cameras. Here you can tell the camera to make the image e.g. twice darker or brighter than the automatic measurement. It's a very useful control, especially if we like to use the A/S/P modes and when we work with difficult lighting conditions.
This text makes things a little simpler than they really are -- it is meant as a general introduction. There are more tools we can use to gain more control: optical filters, vibration reduction (image stabilization), metering modes, etc. all can make a big change in real situations. Still, the basic ideas always stay the same and can be universally applied to any type of camera.