The exposure is determined by the combination of the f-stop (size of the iris aperture when it closes down to take the picture) and shutter speed (how long the aperture stays "closed" for). You can think of these two factors as a balance (scale). To maintain the same exposure, if you increase one, you must decrease the other, or vice-versa. For example, if you change the shutter speed from 1/1000th of a second to 1/500th, you are doubling the amount of light that will be used for the exposure since it's being exposed for twice as long. To counteract that (assuming you wanted to maintain the same exposure), you would have to therefore increase the f-stop by one stop, making a smaller aperture that will let in half as much light. Since smaller f-stop numbers really mean a larger iris opening (somewhat confusingly), if your original f-stop was f8, you would change it to f11, which is the next major f-stop number (one stop).
Here is a pretty good explanation of it, probably much better than I gave, but you can find many, many more on the web through the miracle of Google. Try a search for "f-stop aperture shutter speed exposure" or somesuch.
Now why would you want to manually set the shutter speed or aperture if all these combinations give the same exposure? Wouldn't it be easier to just pick one value for each and always use it? Yes, it would be easier, but varying the shutter speed and aperture have different effects, and sometimes one is more desirable than others, depending on what you're going for. A major effect of changing the aperture (f-stop) is that the depth of field, the distance at which things in your image will be in focus, changes with it. As you close down the lens (increase the f-stop number), you get more depth of field, and less as the lens is opened up. With shutter speed, objects in motion may become blurred if the shutter speed is too low. This includes the motion that your hand and fingers impart on the camera, which is why generally photographers do not take handheld pictures at any less than 1/60th of a second shutter speed. However, depth of field and shutter speed can be used as creative elements; there is no "right" setting, you must understand the effects that changing the values will have and decide what you want each photograph to look like when shooting. As examples, you might want to choose a fast shutter speed when shooting a sporting event with very fast-moving objects, or a small (high-numbered) f-stop if you need to keep both near and distant objects in sharp focus together.
A camera's Auto mode will set things for you to get what is generally a good exposure (not too light or too dark overall), but cameras are still fairly "dumb" about these things; they cannot intelligently analyze each scene the way the human mind can, nor can they know the photographer's creative intentions. Thus, Auto mode is always a compromise, although not always a bad one. First I would suggest you read some online material, but preferably a comprehensive book that starts with the basics (I would search
Amazon.com and read some reviews). When you set the shutter speed and aperture manually, you are in full Manual mode. However, many cameras have several "semiautomatic" modes that let you experiment with effect while still having the camera calculate a decent exposure. Aperture Priority mode lets you choose the aperture manually, then the camera will select the shutter speed automatically based on your choice. Conversely, Shutter Priority mode lets you choose a manual shutter speed and the camera will select an appropriate aperture for you. These two modes, if available to you, can be a great way to experiment and still expect good exposure before you move on to full Manual mode once you get some experience. Even this is a very primitive explanation, you really need to do some serious studying and practice shooting to really understand it (fortunately digital images are essential "free", so you can shoot a ton). Choose subjects and shoot a series of shots varying either shutter speed or aperture and compare the results. Try a tennis match, a flowing stream or waterfall, or a close-up portrait of a person or object in the foreground with the distant horizon in the background and you will begin to understand what happens when you move these values around. Good luck.