\documentclass[12pt]{article}
\newlength{\lOne} \setlength{\lOne}{1cm}
\newlength{\lTwo} \setlength{\lTwo}{2cm}
\newlength{\lThree}

\begin{document}
\ifdim\lOne>\lTwo% l1 > l2
  \setlength{\lThree}{\lOne}%
\else%
  \setlength{\lThree}{\lTwo}%
\fi
\begin{tabular}{ll}
Length lOne:  &\the\lOne\\
Length lTwo:  &\the\lTwo\\
Length lThree:&\the\lThree
\end{tabular}
\vspace{1cm}

\setlength{\lThree}{\ifdim\lOne<\lTwo\lOne\else\lTwo\fi}% l1 < l2
\begin{tabular}{ll}
Length lOne:  &\the\lOne\\
Length lTwo:  &\the\lTwo\\
Length lThree:&\the\lThree
\end{tabular}
\end{document}
