In phonetics, length refers to sounds that are distinctively longer than other sounds. There are long vowels as well as long consonants (the latter are often called geminates).
Strictly speaking, a pair of a long sound and a short sound should be identical except for their duration. In certain languages, however, there are pairs of sounds that are traditionally considered to be long-short pairs of the same sound even though they really consist of different sounds, e.g. German "long e" which is (as in Beet /beːt/ 'garden bed') vs. "short e" which is /ɛ/ (as in Bett /bɛt/ 'sleeping bed') or English "long e" which is /iː/ (as in weed /wiːd/) vs. "short e" which is /ɛ/ (as in wed /wɛd/).
Many languages do not have distinctive length. Among the languages that have distinctive length, there are only a few that have both distinctive vowel length and distinctive consonant length. It is more common that there is only either or that they depend on each other.
In non-linear phonology, the feature of length is often not a feature of a specific sound segment, but rather of the whole syllable.