Answer
$$h= L-L \cos \theta $$
Work Step by Step
To find the height $h$, one should draw a line from the pendulum to the vertical line, perpendicular to it. Now, one can find the height $h$ by subtracting the sides of the resultant right triangle from $L$, that is,$$h= L-L \cos \theta .$$
We have used the fact that in any right triangle $\cos \theta$ equals the ratio of the length of the hypotenuse to the length of the adjacent side.