Collect
Since it hasn't been mentioned (and one can interpret the question in another way) I'd recommend to use also Collect (it can be applied not only to polynomials) :
Collect[(x + y)^2, x]
x^2 + 2 x y + y^2
In more general cases it would be handy to use the second argument in the form of List, e.g. Collect[(x + y)^2, {x, y}].
Comparing it to Expand let's try Collect with PolynomialForm :
Collect[(x + y + z)^3, x] // PolynomialForm[ #, TraditionalOrder -> True] &
x^3 + (3 y + 3 z) x^2 + (3 y^2 + 6 z y + 3 z^2) x + y^3 + z^3 + 3 y z^2 + 3 y^2 z
it collects terms with various powers of x only, while this expands terms with positive integer power in the expression :
Expand[(x + y + z)^3]
x^3 + 3 x^2 y + 3 x y^2 + y^3 + 3 x^2 z + 6 x y z + 3 y^2 z + 3 x z^2 + 3 y z^2 + z^3
Expand
It could be useful to take a look at the second argument of Expand e.g.
Expand[(x + y)^2 + (y + z)^2, x]
x^2 + 2 x y + y^2 + (y + z)^2
it leaves unexpanded terms free of x.
Edit
Let's add another functions which can also expand polynomials ( they serve different purposes though ) like :
GroebnerBasis
GroebnerBasis[(x + y)^2, x][[1]]
x^2 + 2 x y + y^2
And @@ ( GroebnerBasis[(x + y + w + z)^#, x][[1]] == Expand[(x + y + w + z)^#] & /@ Range[2, 10])
True
PolynomialReduce
PolynomialReduce[(x + y)^2, 1, x][[1, 1]]
x^2 + 2 x y + y^2
And @@ ( PolynomialReduce[(x + y + w + z)^#, 1, {x, y, w, z}][[1,1]]
== Expand[(x + y + w + z)^# ] & /@ Range[2, 10])
True