Latency is the period of time between the moment that the microphone picks up a sound and the moment that the computer starts playing the sound. This delay occurs because the audio signal does not travel instantly through the computer: for the sound to pass from the mic to the speakers, it must travel through the computer. The time that the computer requires to process the audio signal determines the degree of latency: the longer it takes to process the sound, the more noticeable the latency becomes.
Many higher-end sound cards include support for Steinberg's ASIO audio processing standard. ASIO reduces latency by performing as much audio processing as possible using the sound card itself, rather than involving Windows in the process. This standard can greatly reduce latency, as the audio signal need only pass from the mic to the sound card to the speakers, rather than through the Windows sound drivers. Adding a sound card that supports ASIO to your system will help improve latency while recording.
To reduce the latency of your sound card, download and install the most recent ASIO drivers for the card from the manufacturer's website. If your sound card supports ASIO, but the manufacturer does not make a set of ASIO drivers available, download and install the generic ASIO4ALL drivers. Enable the ASIO driver in your digital audio workstation, then open the sound card configuration section of your workstation and lower the "Buffer Size" setting to improve the latency. If you experience audio artifacts while recording, increase the buffer size gradually until they disappear.
Digital Signal Processing cards allow you to add audio effects to your music while recording. A DSP card, for example, could compress the audio signal as you record, or add reverb to the recording. If you're routing the audio signal through both a DSP effects card and a sound card, the latency of the recording will increase. To prevent this issue, use a sound card that contains built-in DSP effects on the card itself. Enabling these built-in effects will not add any latency to the recording.