24. Given a quadrilateral $ABCD$ with all sides of positive integer lengths, perimeter $p$, $\angle B$ and $\angle C$ are both right angles, $AB=2$, and $CD=AD$. If $p<2015$, then the number of different possible values of the positive integer $p$ is ( ).
(A) 30
(B) 31
(C) 61
(D) 62
(E) 63
24. B.

As shown in Figure 7, let $B C=x$, $A D=C D=y$. Draw $A E \perp C D$ at point $E$.
Given $A B=2$,
$$
\angle B=\angle C=90^{\circ} \text {, }
$$

we know $A E=B C=x$.
In the right triangle $\triangle A D E$, by the Pythagorean theorem, we have
$$
y^{2}=(y-2)^{2}+x^{2} \Rightarrow x=2 \sqrt{y-1} \text {. }
$$

Thus, $p=x+2 y+2=2 y+2 \sqrt{y-1}+2$.
By the problem, $2 y+2 \sqrt{y-1}+2<2015$, and $y-1$ is a perfect square, so let
$$
f(y)=2 y+2 \sqrt{y-1}+2(y \in[1,+\infty)) .
$$

Therefore, $f(y)$ is monotonically increasing.
Notice that,
$$
\begin{array}{l}
f\left(32^{2}+1\right)=2 \times\left(32^{2}+1\right)+2 \times 32+2 \\
=2116<2015, \\
f\left(31^{2}+1\right)=2 \times\left(31^{2}+1\right)+2 \times 31+2 \\
=1988<2015 .
\end{array}
$$

Thus, $y=1^{2}+1,2^{2}+1, \cdots, 31^{2}+1$.
Therefore, $p$ has 31 different possible values.