From Wikipedia page adding 2 distinct points on Elliptic curve, $P =(x_p,y_p)$ and $Q =(x_q,y_q)$ are given by- $P+Q = R$ $\Rightarrow$ $(x_p,y_p)+(x_q,y_q) = (x_r,y_r)$
where,
$\lambda = \frac{y_q-y_p}{x_q-x_p}$
$x_r = \lambda^2-x_p-x_q$
$y_r = \lambda(x_p-x_r)-y_p$
My question is, what if $x_p = x_q$ but $y_q \neq y_p$ (which makes $\lambda$ undefined)? And will it make any difference if the Elliptic curve is a prime curve over $Z_P$?
You are talking about an elliptic curve that is given by the reduced Weierstrass equation $y^2 = x^3 + ax + b$.
In that case, the negative $-P$ of a point $P=(x_P, y_P)$ is simply $(x_P, -y_P)$.
Thus if $x_P = x_Q$ and $y_P \neq y_Q$, then you know that $Q = -P$, hence $P + Q = O$, the infinite point on the curve.
(This actually appeared in your quoted page, several lines above your quoted part, in the section "Point negation".)