Expand Early or Deny Expansions
To expand means to build a main structure (command center, nexus or hatchery) on a new resource node in order to gather additional minerals and vespene gas. Your strategies should always include expansion plans and means to deny your opponent of resources. Pressure the enemy, seek his expansions aggressively and set up your own while he's busy scrambling to repel your troops.
If you neglect expanding, you will not have enough resources to sustain your production or build the units you need. You'll want at least one expansion in most games—but the more you have, the better off you'll be.
Where to Expand?
Setting up an expansion requires a fair amount of strategy and thought regarding the psychology of your opponent(s). When choosing a location to expand to, try to select the safest option possible. Setting up in the resource node that is easiest for you to maintain and defend should be the main objective, but it may be beneficial to create a hidden expansion. If the enemy is good at scouting, however, he'll find your base no matter where you build it. It is in your best interest to consider carefully when and where to expand, as well as having a solid backup plan if things take a turn for the worst.
After destroying an enemy expansion, sometimes it is a good idea to claim it for yourself. If your units are already assaulting the base, you'll have some standing forces in site to protect your assets.
Sometimes, the last place the enemy will check for expansions are the resource spots right next to their base. Often they assume you would never be so bold as to build in "their" territory. This can be a tactically sound move, especially if you push the advantage and turn that expansion into a forward outpost from which to deploy troops against your opponent's main base. If you don't want to invest heavily in an expansion, this would be a losing proposition. You're better off expanding somewhere else.
If your main base or expansion is destroyed, it can be beneficial to go back and rebuild in the same spot. Your opponents will often expect you to go find a new location to avoid further attacks and to take advantage of a fresh resource node. They are less likely to think you'll go back to the same place because they know you know they know about it. But, since you know that they know that you know that they know... there's a good chance they won't go back to check on an area that they've previously cleared.
There are trade-offs for building close to your main base or far away. If you build at the closest resource node near your main base, you can deploy reinforcements quickly to protect it. On the other hand, your opponents will often expect you to build there, so it is more likely for them to attack. Building further away can provide you with a better chance of hiding until your new expansion is defended and fully functional, but you also run the risk of the enemy finding it early on by mistake or design, and being unable to protect it should it come under attack.
Hide your Worker
If you've reached the location where you want to build your expansion, but are not ready to do so yet (usually due to lack of resources), hide any worker you may have sent to that location. When enemy players scout expansion spots, they often don't do a thorough search all the way around them, and can easily miss units in hiding. Zerg players can burrow drones until they are ready to proceed.
Defend your new Base
If you build an expansion, protect it! Undefended expansions are easy marks for your enemies, and can represent a significant resource loss if destroyed.
The majority of players build one expansion at a time, but you can try building two or more at once. If the enemy finds one, put up a big fight for it, acting like it is the only thing that keeps you afloat. Meanwhile, use your other expansions to build up and collect minerals and gas. If the enemy destroys this 'decoy' base, you will still have one or more expansions where resources are being gathered. The enemy may then focus on your main base, thinking that's all you have left.
The zerg typically expand more than other races. When fighting zerg players make sure you keep tabs on expansion spots.
Don't Give your Expansion Away
Delay the enemy's discovery of your expansion for as long as possible. Do not give your opponent any reason to think you have another base. Try not to lead enemy units from your main base to your expansion, and intercept or divert any enemy air or ground units that might seek to compromise the secrecy of your operations.
When a base's main building (command center, nexus, or hatchery) is destroyed, the workers gathering there will automatically head to the nearest remaining headquarters. The enemy will most likely know where your main base is located, but if he sees your workers heading in a different direction, he may suspect you have additional expansions. When your main building is about to be destroyed, select the workers, stop them, or send them in the opposite direction of your other bases in an attempt to mislead your opponent.
Scout for Enemy Expansions
The best defense is a good offense. Be aggressive, scout often, and check every expansion thoroughly. Even if you're completely certain that the game is won, or that the enemy is not playing well enough to be expanding, it's better to be safe than sorry.