$p^2-1$=$(p-1)$$\times$$(p+1)$.
Since p is a prime number, one of p-1 or p+1 must be divisible by 3, and since p-1 is even and p+1 is also even. then one of them is divisible by 2 and the other by 4 . Therefore it is divisible by 4$\times$3$\times$2=24.
$\therefore$ G.C.D would be 24.