Determine all pairs $(p, q)$ of prime numbers such that $p^p + q^q + 1$ is divisible by $pq.$
1. **Assume \( p \leq q \)**: Without loss of generality, we can assume \( p \leq q \). If \( p = q \), then \( p \mid 1 \), which is impossible since \( p \) is a prime number. Therefore, \( p \neq q \).

2. **Divisibility conditions**: Given \( pq \mid p^p + q^q + 1 \), we have:
   \[
   p \mid q^q + 1 \quad \text{and} \quad q \mid p^p + 1
   \]

3. **Case \( p = 2 \)**: Consider \( p = 2 \):
   \[
   q \mid 2^2 + 1 = 5
   \]
   Since \( q \) is a prime number, the only possible value for \( q \) is 5. Therefore, \( (p, q) = (2, 5) \) is a solution.

4. **General case \( p \) and \( q \) are odd primes**: Assume \( p \) and \( q \) are both odd primes. We need to show that no other pairs \((p, q)\) satisfy the given condition.

5. **Using Fermat's Little Theorem**: By Fermat's Little Theorem, we have:
   \[
   q^{p-1} \equiv 1 \pmod{p} \quad \text{and} \quad p^{q-1} \equiv 1 \pmod{q}
   \]
   Therefore, we can write:
   \[
   q^{\gcd(2q, p-1)} \equiv 1 \pmod{p} \quad \text{and} \quad p^{\gcd(2p, q-1)} \equiv 1 \pmod{q}
   \]

6. **Analyzing \(\gcd\) values**: Since \( q \) is odd and greater than \( p-1 \), we have:
   \[
   \gcd(q, p-1) = 1
   \]
   Thus:
   \[
   q^2 \equiv 1 \pmod{p}
   \]
   This implies:
   \[
   p \mid (q+1)(q-1)
   \]

7. **Divisibility by \( p \)**: Since \( p \) is a prime, it must divide either \( q-1 \) or \( q+1 \). If \( p \mid q-1 \), then:
   \[
   p \mid q^q - 1
   \]
   But this would imply:
   \[
   p \mid q^q + 1 - (q^q - 1) = 2
   \]
   which is a contradiction since \( p \) is an odd prime. Therefore, \( p \mid q + 1 \).

8. **Analyzing \(\gcd\) values for \( q \)**: Since \( p \) cannot divide \( q-1 \), we have:
   \[
   \gcd(2p, q-1) = 2
   \]
   Thus:
   \[
   p^2 \equiv 1 \pmod{q}
   \]
   This implies:
   \[
   q \mid (p+1)(p-1)
   \]

9. **Divisibility by \( q \)**: Since \( q \) is a prime, it must divide either \( p-1 \) or \( p+1 \). However, since \( q > p \), \( q \) cannot divide \( p-1 \) or \( p+1 \). This leads to a contradiction.

10. **Conclusion**: The only solution is \( (p, q) = (2, 5) \).

The final answer is \( \boxed{ (2, 5) } \)