You can either look it up as a formula or do it in steps. As you said:

(x + y)^2 = x^2 + 2xy + y^2. Thus:

(x + y)^3 = (x + y)(x^2 + 2xy + y^2) = x(x^2 + 2xy + y^2) + y(x^2 + 2xy + y^2)

= x^3 + 2x^2y + xy^2 + x^2y + 2xy^2 + y^3

So

(x + y)^3 = x^3 + 3x^2y + 3xy^2 + y^3

Similarly:

(x - y)^3 = x^3 - 3x^2y + 3xy^2 - y^3

-Dan