Many new cameras will come with built-in shutter speeds of up to 30 seconds or longer, which is enough for most long-exposure photography. Other cameras will have a B (bulb) setting that will keep the shutter open as long as you keep your finger on the shutter release button or a T (time) exposure setting that will keep the shutter open until you press the shutter release button a second time. Cameras with bulb settings can also be fitted with a locking cable release so that it isn't necessary to keep your finger on the shutter for long exposures. If your camera doesn't have a cable release, you can use the self-timer option found on most cameras. This will eliminate camera vibration from your hands.
A tripod, or something to rest your camera on, is essential because the camera must be completely still during the time that the shutter is open. If you want to make a fast-moving car blur as it speeds by you, a relatively fast shutter speed of 1/20 of a second may give you the results you are after, however, if you want to make stars in the nighttime sky look like glowing rings as the earth rotates, your exposure may last all night.
The light meter on your camera may not be able to accurately judge the best aperture setting for longer shutter speeds, especially in low-light situations, so your best bet is probably to "bracket." This means taking up to six pictures of the same subject, but doubling the shutter speed each time. This will give you a variety of effects and exposures and allow you to choose the best shot. In general, slow shutter speeds will allow a lot of light into the camera, which means that you will want to use a small aperture (ie. f/22) to avoid over-exposing the shot. In bright daylight it will be necessary to use the lowest ISO available and a neutral density filter to cut the light down.
Some great effects and shutter speeds to try are:
Moving stars: several hours
Moving cars at night: 10 seconds
Waterfalls: 4 seconds +
Amusement park rides: 1 second