Water contracts when it is heated from freezing point to 7 degrees above and begins to expand as it heats up further. Water expands when it freezes, as well as when it heats up, except for the 7 degrees above freezing where it contracts.
A good way for people to better understand how this works is to freeze water. After it is in ice form, it can begin to heat up and thaw out. Watching this, it is easy to see when the water is contracting. It melts and gets smaller. It is easier to put 3 cups of liquid water into a bowl than it is to put 3 cups of frozen ice into a bowl. Water will slightly expand when it is boiled, although it is not as noticeable of an expansion as when the water freezes.
One of the biggest instances of water heating up and expanding is the effect of global warming. As the planet becomes hotter, so does everything else around it. When the planet, the land and everything else get hot, the water also gets hotter. Despite it being only a minor temperature change, the water is still affected by it. Water that heats up will expand and oceans can expand just as easily as boiling water in a pot. When oceans expand, they sometimes have no place to go except on land, which could potentially wipe out any land that is on the earth.