If I and J are "coprime" (i.e., if I+J = R) then it's true that the I∩J=IJ, so the two definitions are the same. This is true for example if I and J are distinct primes.This is true for example if I and J are distinct primes. To illustrate the kind of thing that happens when there are common factors, consider this silly example: R = ℝ[x,y], I = J = (x). So the union of the two varieties of these ideals is again the y-axis, and the question you need to ask is what do you want as the ring of functions on the union--do you want *R/*I∩J = ℝ[x,y]/(x) or do you want R/IJ = ℝ[x,y]/(x2). the issue is that in the world of algebraic geometry, this choice matters, since an algebraic variety is not only defined by its points, but also it's ring of functions. it seems reasonable that you would want X ∪ X = X for any variety X, so you'd better choose the first choice.
as a side note, the second choice is an example of a "nonreduced" variety, which i guess you wouldn't usually(?) see in a first course on algebraic geometry. it has more functions on it: one "full" dimension plus one "infinitesimal" dimension (i.e., with only linear functions in that direction).