An odd prime p has a form either 1(mod 4) or 3(mod 4). We can see that 1(mod 4) is reducible in Z[i] (For example, 5=(1+2i)(1-2i)). An odd prime p is irreducible iff it has the form 3(mod 4).

We know that Z[i] is an integral domain and a PID. We also know that is irreducible. Thus <p> is maximal ideal in Z[i]. It follows that Z[i]/<p> is a field having p^2 elements.