As noted above, you need to have set up Find My iPhone on your device prior to it getting lost or stolen. If you did, go to https://www.icloud.com/ in your web browser (there's also a Find My iPhone app [opens iTunes link] that you can install on another iOS device to track it. These instructions are for using the web-based tool).
Log in using the account you used when setting up Find My iPhone. This may be your Apple ID/iTunes account.
When you log in, Find My iPhone will immediately begin trying to locate your device. You'll see onscreen messages as it works. If the device is turned off, the map will display its last known location, not necessarily its current location. When it's turned back on, the map will update.
If it finds your device, it will zoom in on the map and show the location of the device using a blue dot. When this happens, you can zoom in or out of the map, and view it in map, satellite, and hybrid modes, like any Google Map.
When your device is found, a window will pop up over the blue dot (if it disappears because you clicked elsewhere on the page, just click the blue dot again to get it back). Click the window and you'll see the various options you have.
The first option is to send a message to the device or have it play a sound. You can send a message--for instance, letting someone know how to return the device to you--that will appear onscreen like a text message.
Sending a sound to the device is best when you think you've misplaced your device in the house or office and want help finding it.
You can also click the "lock" button. This will allow you to remotely lock the device's screen and set a passcode (even if you hadn't previously used a passcode) that will prevent the thief from using your device or accessing your personal data.
To do this, click the "lock" button, enter the 4-digit lock code you want to use twice, and then click "lock" again. Your device will now be inaccessible to the thief unless they guess your code.
For even greater security, you can also remotely delete all data from the device. To do this, click the "wipe" button. There, you'll see a warning (basically, don't do this unless you're absolutely sure you want to). Click the box that says you understand what you're doing and click the "Erase All Data" button. This will delete all your data, preventing the thief from accessing it.
If you get the device back, you can restore your data from backup.
If you think your device is on the move, click the curved arrow at the top right corner of the screen to refresh and get a new fix on your device's location.