Lengths
A length is a measure of distance. Many LaTeX commands take a length as an argument.
Lengths come in two types. A rigid length (what Plain TeX calls a dimen) such as 10pt cannot contain a plus or minus component. A rubber length (what Plain TeX calls a skip) can contain those, as with 1cm plus0.05cm minus0.01cm. These give the ability to stretch or shrink; the length in the prior sentence could appear in the output as long as 1.05 cm or as short as 0.99 cm, depending on what TeX’s typesetting algorithm finds optimum.
The plus or minus component of a rubber length can contain a fill component, as in 1in plus2fill. This gives the length infinite stretchability or shrinkability, so that the length in the prior sentence can be set by TeX to any distance greater than or equal to 1 inch. TeX actually provides three infinite glue components fil, fill, and filll, such that the later ones overcome the earlier ones, but only the middle value is ordinarily used. See \hfill, See \vfill.
Multiplying an entire rubber length by a number turns it into a rigid length, so that after \setlength{\ylength}{1in plus 0.2in} and \setlength{\zlength}{3\ylength} then the value of \zlength is 3in.

Units of length
TeX and LaTeX know about these units both inside and outside of math mode.
pt 	 Point 1/72.27 inch. The conversion to metric units, to two decimal places, is 1point = 2.85mm = 28.45cm.
pc 	 Pica, 12 pt
in 	 Inch, 72.27 pt
bp 	 Big point, 1/72 inch. This length is the definition of a point in PostScript and many desktop publishing systems.
cm 	 Centimeter
mm 	 Millimeter
dd 	 Didot point, 1.07 pt
cc 	 Cicero, 12 dd
sp 	 Scaled point, 1/65536 pt
Two other lengths that are often used are values set by the designer of the font. The x-height of the current font ex, traditionally the height of the lower case letter x, is often used for vertical lengths. Similarly em, traditionally the width of the capital letter M, is often used for horizontal lengths (there is also \enspace, which is 0.5em). Use of these can help make a definition work better across font changes. For example, a definition of the vertical space between list items given as \setlength{\itemsep}{1ex plus 0.05ex minus 0.01ex} is more likely to still be reasonable if the font is changed than a definition given in points.
In math mode, many definitions are expressed in terms of the math unit mu given by 1 em = 18 mu, where the em is taken from the current math symbols family. See Spacing in math mode.

\setlength{\len}{value}
The \setlength sets the value of \len to the value argument, which can be expressed in any units that LaTeX understands, i.e., inches (in), millimeters (mm), points (pt), big points (bp, etc.

\addtolength{\len}{amount}
The \addtolength command increments a “length command” \len by the amount specified in the amount argument, which may be negative.

\settodepth
\settodepth{\gnat}{text}
The \settodepth command sets the value of a length command equal to the depth of the text argument.

\settoheight
\settoheight{\gnat}{text}
The \settoheight command sets the value of a length command equal to the height of the text argument.

\settowidth{\len}{text}
The \settowidth command sets the value of the command \len to the width of the text argument.

Predefined lengths
\width
\height
\depth
\totalheight
These length parameters can be used in the arguments of the box-making commands (see Boxes). They specify the natural width, etc., of the text in the box. \totalheight equals \height + \depth. To make a box with the text stretched to double the natural size, e.g., say
\makebox[2\width]{Get a stretcher}