When taking a photograph, the image isn't created immediately, but over time. A higher shutter speed provides less exposure to the light, and thus the resulting image will be darker than a slower shutter speed that allows greater exposure, if all settings are the same.
This can be compensated by making your camera more sensitive to light (raising your ISO, at the cost of noise), allowing more light through your lens (by widening the aperture), or lowering the shutter speed to allow more time.
To help guide your decisions, there is usually a meter towards the bottom of the viewfinder. When its marked in the center, this generally means you should get about the right amount of light.