An easy way to remember what an aperture / f-stop does is to think of it like the pupil in your eye. When it is bright outside, your pupil constricts or shrinks to limit the amount of light reaching the inside of your eye. When it is dark out, your pupil dilates to allow more light in. The aperture in your lens acts in the same way; either manually by your choosing or automatically as needed when your camera is in auto. So in short, the aperture in your camera regulates the amount of light that gets into your camera to its sensor.
Your aperture does one more very important thing as a byproduct of the sizes chosen. Your depth of field is dependent (hereafter referred to as DOF) on the aperture size. DOF is important for many reasons. When shooting landscape photography ideally, you want the greatest DOF possible so everything from the foreground to infinity is in focus. In portrait photography, most photographers prefer the shallowest DOF possible so the photographic subject will be the focal point.
So how does the aperture affect DOF? Well in simple terms, the larger your aperture, the shallower the DOF. Conversely, the smaller your aperture, the greater your DOF. This is illustrated in the graphic below.
For the sake of this lesson, let's assume your camera is in manual mode (my preferred shooting mode). I am at a state park and want to shoot a nice landscape shot. Let's assume it's a bright sunny day and there is plenty of light available to take your photo. There are many variables here to consider such as your shutter speeds, if you are using a polarizer (which cuts down on light), lens length, etc. For the sake of this article, let assume that you are using a Canon Camera with the 50mm , f/1.8 AKA the nifty fifty. You should try and close down the shutter a bit to insure good DOF. I would try and get at least F/8 to take a good landscape photo. Assuming you have enough light at F/8 to get a shutter speed that is conducible to hand holding (1/50th or faster if you have steady hands with this lens), you should get a nice clear photo with everything in focus from the foreground to infinity (represented as ∞ on most lenses).
Let's say later you see a cute photo opportunity of your child and want to take a good portrait of him/her. I've taken portraits with everything from 50mm to about 105mm and they all work good for me. Most portrait photographers subscribe to the theory that a very shallow DOF is best for portraits; as a general rule, I agree. If this is the case, you will want to open up your aperture very wide. While you can open up the nifty fifty to f/1.8, the image quality to me at least at f/1.8 leaves something to be desired. If your copy is better, then f/1.8 should be fine but focus has to be spot on. I personally prefer at least f/2.8 for my portraits and the focus accuracy is a little more forgiving.
In older lenses, you used to be able to calculate your DOF from the markings on the lenses. The newer lenses make it a little more difficult. Many camera companies used to include (and some still do) a DOF preview button. I've never really found much use for it and have always pretty much considered it a gimmick or maybe someone just hasn't showed me the correct way :).
So how do you choose an aperture on your camera when your aperture setting is a priority? There are basically two ways in all cameras. In manual mode where you can choose your shutter speed and your aperture, you just select your aperture first by what ever means your camera uses and select the appropriate shutter speed second. Most all cameras have a mode called Aperture Priority (represented on most dials as AP or AV). In this setting, you just select the aperture of your choice and the camera will select the appropriate shutter speed. This works fairly well as long as your subject(s) are not back-lit or you need to stop action.
Lastly, as a general rule, lenses with larger apertures run more expensive because they are harder to make accurately, use more glass and coatings to cope with fringing, etc. cost money. There are many, many other topics to cover relating to apertures but these are the bare bones basics. You can click on the graphic below to see a larger version.