Find the number of pairs of positive integers $(a, p)$ such that:
[list]
[*]$p$ is a prime greater than $2.$
[*]$1 \le a \le 2024.$
[*]$a< p^4.$
[*]$ap^4 + 2p^3 + 2p^2 + 1$ is a perfect square.

1. We start with the equation \( x^2 = ap^4 + 2p^3 + 2p^2 + 1 \). We need to find pairs \((a, p)\) such that this equation holds, where \( p \) is a prime greater than 2, \( 1 \le a \le 2024 \), and \( a < p^4 \).

2. Consider the equation modulo \( p^4 \):
   \[
   x^2 \equiv ap^4 + 2p^3 + 2p^2 + 1 \pmod{p^4}
   \]
   Since \( ap^4 \equiv 0 \pmod{p^4} \), we have:
   \[
   x^2 \equiv 2p^3 + 2p^2 + 1 \pmod{p^4}
   \]

3. We need \( x \) such that \( x \equiv \pm (p^3 + p^2 + 1) \pmod{p^4} \). This is because:
   \[
   (p^3 + p^2 + 1)^2 = p^6 + 2p^5 + 3p^4 + 2p^3 + 2p^2 + 1 \equiv 2p^3 + 2p^2 + 1 \pmod{p^4}
   \]
   and
   \[
   (p^4 - p^3 - p^2 - 1)^2 = p^8 - 2p^7 + 3p^6 - 2p^5 + 2p^4 - 2p^3 - 2p^2 + 1 \equiv 2p^3 + 2p^2 + 1 \pmod{p^4}
   \]

4. Therefore, \( x \) must be either \( p^3 + p^2 + 1 \) or \( p^4 - p^3 - p^2 - 1 \).

5. If \( x = p^3 + p^2 + 1 \), then:
   \[
   (p^3 + p^2 + 1)^2 = ap^4 + 2p^3 + 2p^2 + 1
   \]
   Expanding and comparing coefficients, we get:
   \[
   p^6 + 2p^5 + 3p^4 + 2p^3 + 2p^2 + 1 = ap^4 + 2p^3 + 2p^2 + 1
   \]
   Thus, \( a = (p+1)^2 \).

6. If \( x = p^4 - p^3 - p^2 - 1 \), then:
   \[
   (p^4 - p^3 - p^2 - 1)^2 = ap^4 + 2p^3 + 2p^2 + 1
   \]
   Expanding and comparing coefficients, we get:
   \[
   p^8 - 2p^7 + 3p^6 - 2p^5 + 2p^4 - 2p^3 - 2p^2 + 1 = ap^4 + 2p^3 + 2p^2 + 1
   \]
   Thus, \( a = p^4 - 2p^3 - p^2 + 2p - 1 \).

7. We now count the number of valid pairs \((a, p)\):
   - For \( a = (p+1)^2 \), we need \( 1 \le (p+1)^2 \le 2024 \). Solving for \( p \):
     \[
     1 \le (p+1)^2 \le 2024 \implies 1 \le p+1 \le \sqrt{2024} \implies 0 \le p \le 44
     \]
     The primes less than or equal to 43 are: 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43. There are 13 such primes.

   - For \( a = p^4 - 2p^3 - p^2 + 2p - 1 \), we need \( 1 \le p^4 - 2p^3 - p^2 + 2p - 1 \le 2024 \). Solving for \( p \):
     \[
     p^4 - 2p^3 - p^2 + 2p - 1 \le 2024
     \]
     This is a more complex inequality, but we can check small primes:
     - For \( p = 3 \), \( a = 3^4 - 2 \cdot 3^3 - 3^2 + 2 \cdot 3 - 1 = 81 - 54 - 9 + 6 - 1 = 23 \) (valid).
     - For \( p = 5 \), \( a = 5^4 - 2 \cdot 5^3 - 5^2 + 2 \cdot 5 - 1 = 625 - 250 - 25 + 10 - 1 = 359 \) (valid).
     - For \( p = 7 \), \( a = 7^4 - 2 \cdot 7^3 - 7^2 + 2 \cdot 7 - 1 = 2401 - 686 - 49 + 14 - 1 = 1679 \) (valid).

     Thus, there are 3 such primes.

8. Adding the number of pairs from both cases, we get:
   \[
   13 + 3 = 16
   \]

The final answer is \(\boxed{16}\)