Once upgraded at the cybernetics core, gateways can be transformed into warp gates, which allow ground units to warp-in to any location powered by a pylon or warp prism in phasing mode. This increases production rate and allows for troop deployment virtually anywhere (provided there's a power field to warp-in to). Take into account, however, that you can only warp-in one unit at a time per warp gate, and there's a brief cooldown period before you can create another unit. The cost in minerals/vespene gas per unit does not change in any way when using warp gates.
The warp-in process isn't instant. There's a small window of opportunity in which the enemy can kill your units before they appear. Because of this, you want to warp-in away from enemy forces, or have standing troops covering their arrival.
Unless you're planning to execute an all-in tactic in the early game, warp gates are a necessity. They are objectively better than gateways, so be sure to research the upgrade as soon as possible. The cost is 50 minerals/50 vespene gas; claim your first geyser early. In general, if you are not going for a fast expansion, you should build an assimilator right after the first gateway. When the gateway finishes, build the cybernetics core and begin research as soon as construction is completed. If you want to rush down your opponent, use chrono boost to speed up warp gate research.
Having three to four warp gates per each fully saturated base you own is optimal. However, the trick is to keep on building warp gates until you can produce enough units to keep up with your resource income and psi-limit. You can select all your warp gates at once by pressing the W key.
In order to use your warp gates offensively, you'll need to set up a power field near the enemy. Sneak pylons around the map, and in tactically advantageous locations whenever possible, but away from the beaten path. It's likely that the enemy will only find you through aggressive scouting, or if your placement choices were not very sound. If you cannot get a power field exactly where you want it, use the phase prisms' phasing ability. Remember, both pylons and phase prisms are very vulnerable without proper support.
When you attack the enemy, bring a probe along. Create a pylon outside your opponent's base, or halfway through the map, and use it to warp in reinforcements.
If you assign every nexus you have to the same hotkey, you'll be able to quickly cast chrono boost on your warp gates. This will speed up the cooldown period, allowing you to produce more units faster. Remember, you can select all nearby structures of a single type if you control click or double click on one of them.
Place a pylon in or around an enemy base to warp in units
Check out this screenshot. One protoss player sneaks outside the base of another protoss player.
Warp up to high ground
You can place a pylon on low ground and then warp units to high ground as seen in this screenshot.
A warp prism comes in for an attack.
A warp prism converts to phase mode, the probe builds a pylon and units are warped into the island. The terran expansion is thwarted.