And what is roughly the ratio of the charging speed in USB vs charger? My phone is Samsung Galaxy S, if that matters.
A computer USB port is limited to 500 milliamperes (or 900 mA for a USB 3.0 port). The dedicated wall charger, on the other hand, is usually able to provide 1000 mA or more.
Let's take the case where a connected phone uses 200 mA. Then, the USB port would have 300 mA left to charge the battery while the wall USB charger would have 800 mA left. A typical smart phone battery has a capacity of about 1500 mAh (milliamperes-hour) nowadays. This means that in a perfectly efficient world, a current of 1500 mA would charge the battery in 1 hour. So the same battery would then charge in 5 hours over the USB 2.0 port and in about 1h50 with the wall charger.
Of course in reality power losses would also affect charging times but these numbers are quite close to what I get with my actual phone.
Charging from a USB port of a computer is slower than charging using a charger because the voltage and amperage provided by the computer is considerably lower than in the case of using a normal charger, so the mobile is using “slow charge mode”
I don’t know which is the charging speed ration between USB and normal charger in the case of a SGS, but in my case (HTC Desire) with a normal charger I need approximately 2 to 3 hours for a full charge, but with a USB connection that time only charges 15 to 35 percent.
The reason your android device draws less power from your USB connection than from a wall adapter is because of the USB specification. This can be side-stepped by shorting the data wires in in the USB cable, which will switch the phone or tablet into wall mode where it can draw the full available current. The amount of current available will vary considerably from PC to PC.
The reason the specification exists in the first place is that the voltage to the computer's USB ports is usually supplied via the motherboard by a single loop connection which services all of the USB ports at once. Being only a few microns thick, this circuit is not able to deliver the same current as a dedicated charging wire. It is highly improbable that you will 'burn out your motherboard' by trying to draw the full available current through this circuit (although it is theoretically possible if your computer was a total P.O.S. to begin with). What is more likely to happen is that you will exceed the manufacturer's design specification, thereby denying sufficient power to any other USB devices you have connected, and/or other internal circuits which can cause the PC to crash. This is the very same reason it is recommended you use powered USB hubs.
A word of caution, while we all want our batteries to charge fast, be aware that the faster you charge a battery, the warmer it gets, and heat destroys battery life. A battery charge to full each time @ 0.5 amps will last longer than one charged to full each time @ 1.0 amps. I don't know enough to say this small difference is enough to be of concern for a cell phone battery, but I have found out that using an iPad charger (5.2V, 2.4amp) vs the recommended PC USB port (5V, 0.5amp) charge rate will shorten the life of a Bose noise canceling earbud battery. Happy charging.
Consider that computers often have other things inside of them or connected to them that need the same charge. The power within a computer itself is always lower than direct power from a outlet from a wall. When power is distributed through a computer to your phone, that same amount of power is also being used throughout the whole computer slowing the voltage to your phone, and other things that are plugged up. Always remember, if you want direct power and a quicker charge, its always good to use to wall outlet instead of a computer or labtop.
Samsung bridges pins 2 and 3 facing the phone. If pins 2 and 3 are open, the phone limits your charging capability to about 350 mA or so. Check it out: http://forum.xda-developers.com/showthread.php?t=1384253
Most of the answers here are very informative on the battery issue, I don't want to touch on that, though I should let you know that if you have to charge your android with your laptop or desktop, make sure it gets full before you unplug it, otherwise you will be slowly ending the long life of your battery by unplugging every time you have to leave because it kind of takes longer. I take a major precaution when it comes to charging because I changed my phones charging adapter more than thrice due to charging using my laptop. I was finally advised by my techie to use the specified charger and since then, i have no battery issues. Just a precaution.
Most of the answers are incomplete so I try to answer it, too.
The USB 2.0 specification defines a minimum of 500 mA for the hub and a maximum of 500 mA for the device and the USB 3.0 spec has the same limits for 900 mA: http://www.maxrev.de/files/2014/08/usb_3_0_english.pdf
This means a device (the phone) is not allowed to consume more than 900 mA if it is connected to a hub (the pc) but the hub is allowed to provide as much as possible!
In addition you need to know that the USB specification does not cover USB power supplies. This is covered by the power delivery specification. This means they can deliver up to 2A @ 5V and many smartphones make use of higher currents.
Now back to the PC. A PC with three USB ports is defined as a "hub" and to meet the USB specification it will deliver >500 mA per port. And because its much cheaper to use one power supply, all three ports are connected to the same one. And because of that a device can easily consume >1500 mA if it is the only connected device. But the problem is that the device "talks" to the hub (by using 100 mA) and then both arrange the higher current (500 or 900 mA depending on the USB version).
So to answer the question: Charging from the computer is slower because both devices comply to the USB specification.
But if you fool the device so it thinks its connected to a power supply it can consume its maximum from the hub. For that you need an adaptor called "fast charge adaptor" that shortens the data lines (example 1, example 2).
So a computer port is not limited to 500 or 900 mA as stated in other answers. The limitation comes from the spec.
Note: There exist exceptions. For example mobile devices like ultrabooks are allowed to share the one port minimum for all ports. And I had a HP monitor that interpreted the USB specification very strict and limited the current of one of two USB 3.0 ports to 910 mA (avoiding the usage of many USB 3.0 usb drives that consume for a short time a little bit more).