What is the motivation behind the concept of definition of Gaussian prime numbers?
I am interested about the part of the definition when both real and imaginary coefficients are non-zero. Then a complex number is called a Gaussian prime number iff $a^2+b^2$ is an ordinary prime number. Why?
The Gaussian integers are a subset of complex numbers of the form $a+ib$ where $a$ and $b$ are integers. They are also denoted $\mathbb{Z}[i]$.
The Gaussian primes can be thought of as the intersection of two sets: a) the prime elements of $\mathbb{Z}[i]$ and b) the positive integers.
There's a theorem that says that any prime number is a prime element in $\mathbb{Z}[i]$ if and only if it is congruent to 3 mod 4.
For example, $2$ factors as $(1+i)(1-i) = 1 - (-1) = 1+1 = 2$.
Additionally, $5$ factors as $(2+i)(2-i)$.
The result that you're stating about $a^2 + b^2$ is incomplete:
An element of the Gaussian integers is a prime element if and only if its norm (i.e. $a^2 + b^2$ is prime) or it is a prime number of the form $4n + 3$ (up to multiplication by a unit).
For example, the norm of $3$, which is a Gaussian prime, is $9$, which is not prime.