How to Charge the iPhone With a Computer
The iPhone uses a lithium-ion battery. From an empty state, the rechargeable battery can reach full capacity in four hours. A fully-charged iPhone provides 40 hours of audio playback, 7 hours of talk time on the 3G network or up to 6 hours of Internet use on the 3G network. You can charge your iPhone by connecting it to any computer with an available high-power USB port that is powered on.
Turn on the computer. Make sure it is not in Standby or Sleep mode. If you are using a laptop, the lid must be open and the computer must be powered on.
Plug the 30-pin connector on one end of the cable that came with your iPhone into the 30-pin connector input along the bottom of your iPhone.
Connect the USB connector on the other end of the cable that came with your iPhone into an available high-power USB input on your computer. High-power inputs are found on your computer tower or on your monitor if the traditional tower components are built into your monitor. Low-power USB inputs are often found on keyboards and monitors without traditional tower components built into it. A battery icon appears in the upper-right corner of the iPhone screen with a lightening bolt in the middle of it, signifying that the iPhone is charging.
Leave the iPhone plugged in. When the iPhone is fully charged, a "Plug-in" icon will be displayed inside of the battery outline in the upper-right corner of the screen, in place of the lightening bolt.
Disconnect the USB cable from the computer, then disconnect the 30-pin connector from the bottom of the iPhone.