The Pythagorean theorem is used to calculate the length of the hypotenuse of a right triangle given the lengths of the two other sides. It states that the square of the hypotenuse (c) is equal to the sum of the squares of the other two sides (a and b). The theorem can only be used for right triangles where one of the interior angles is 90 degrees.