Step 1: Area of triangle
\[
A_{\text{triangle}} = \frac{1}{2} \times \text{base} \times \text{height} = \frac{1}{2} \times x \times h
\]
Step 2: Area of square
\[
A_{\text{square}} = x^2
\]
Step 3: Equate the areas
\[
\frac{1}{2} x h = x^2
\Rightarrow h = \frac{2x^2}{x} = \boxed{2x}
\]