24. Given that the sides of quadrilateral $ABCD$ are all positive integers, the perimeter is $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 $(\quad)$.
(A) 30
(B) 31
(C) 61
(D) 62
(E) 63
24. B.

As shown in Figure 7, let $BC = x$, $AD = CD = y$. Draw $AE \perp CD$ at point $E$.
Given $AB = 2$,
$$
\angle B = \angle C = 90^{\circ},
$$

we know $AE = BC = x$.
In the right triangle $\triangle ADE$, by the Pythagorean theorem, we have
$$
y^{2} = (y-2)^{2} + x^{2} \Rightarrow x = 2 \sqrt{y-1}.
$$

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

Therefore, $f(y)$ is monotonically increasing.
Notice that,
$$
\begin{array}{l}
f(32^2 + 1) = 2 \times (32^2 + 1) + 2 \times 32 + 2 \\
= 2116 < 2015, \\
f(31^2 + 1) = 2 \times (31^2 + 1) + 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.