The most common definition is that a nonzero element $p$ is prime if it not invertible and, for all $a,b\in R$, $p\mid ab$ implies $p\mid a$ or $p\mid b$.
Every prime in an integral domain is irreducible: if $p$ is prime and $p=ab$, then either $p\mid a$ or $p\mid b$. If $p\mid b$, we have $b=px$ and so $p=apx$, so $ax=1$ and $a$ is invertible.
Note that the hypothesis that $R$ is an integral domain has been used when canceling $p$ from $p=apx$. If you add in the definition that $p$ is not a zero divisor, then the reasoning can go on in the same fashion.