If you repeatedly enter the wrong passcode, your iPhone will be disabled for longer intervals before you can try again. After too many unsuccessful attempts, you won't be able to try again until you connect it to the computer with which you last synced it [if it has been synced to a computer].
Note: You can configure your device to erase itself after ten consecutive incorrect password attempts. This setting is off by default. It can be turned on by tapping Settings > General > Passcode Lock.
If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it [or iCloud]. This allows you to reset your passcode and resync the data from the device (or restore from a backup). If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present. Please also note that Apple representatives can't unlock an iPhone for you without restoring the iPhone, either. The restore process will erase everything on it. Apple's official instructions to restore an iPhone with iTunes are:
821 questions posted
Usually answered in minutes!
6,597 Questions
4,142 Questions
727 Questions
629 Questions
603 Questions