The definitions are equivalent in a unique factorization domain like $\mathbb Z$. In a non-UFD, there is still a set of prime numbers and a set of irreducible numbers, but they don't overlap completely.
For example, $-37$ is not divisible by any number in $\mathbb Z$ closer to 0 than itself, other than $-1$ and 1. Hence it is irreducible in $\mathbb Z$. But it is also prime, because in any product $ab$ that is divisible by $-37$ we will find that either $a$ or $b$ is a multiple of $-37$, or maybe they both are.
Compare to $74$. That's obviously not prime, and it's not irreducible either, it's reducible. We see that $74 \mid 148$, but if we express 148 as $-4 \times -37$, we see that 74 divides neither the $a$ nor the $b$.
Now let's take a look at an integral domain like $\mathbb Z[\sqrt{-70}]$. In that domain, $-37$ is still irreducible, because it's not divisible by any number closer to 0 other than $-1$ and 1.
But now we see that $-37 \mid (2 - \sqrt{-70})(2 + \sqrt{-70})$, yet neither $2 - \sqrt{-70}$ nor $2 + \sqrt{-70}$ is divisible by $-37$. Numbers like 3 and 13 are still irreducible and prime in $\mathbb Z[\sqrt{-70}]$, though.
As for a number that is prime but not irreducible, consider $\mathbb Z_6$, which consists only of 0, 1, 2, 3, 4, 5 (addition and multiplication "wrap around" to keep things within the ring). Verify that $$3 = 3^2 = 3^3 = 3^4 = \ldots = 3 \times 5 = 3 \times 5^2 = \ldots$$ but also that the only way to get 3 as a product in this ring is to include 3 at least once as a multiplicand.
P.S. I chose $\mathbb Z[\sqrt{-70}]$ rather than $\mathbb Z[\sqrt{78}]$ because even though we have to deal with complex numbers, things are in some ways much simpler.