From the iPhone User Manual:
Pairing Bluetooth devices
Before you can use a Bluetooth device with iPhone, you must first pair them.
Pair a Bluetooth device with iPhone:
- 1 Make the device discoverable.
See the documentation that came with the device. For an Apple Wireless Keyboard, press the On/off switch.
- 2 Go to Settings > Bluetooth and turn Bluetooth on.
- 3 Select the device and, if prompted, enter the passkey or PIN. See the instructions about the passkey or PIN that came with the device.
For information about using an Apple Wireless Keyboard, see Apple Wireless Keyboard on page 24.
To use a Bluetooth headset with iPhone, see the documentation that came with the device.
Return audio output to iPhone when a Bluetooth headset is connected: Turn off or unpair the device, or turn off Bluetooth in Settings > Bluetooth. Audio output returns to iPhone whenever the device is out of range. You can also use AirPlay to switch audio output to iPhone. See AirPlay on page 30.