Apple uses a Lithium Ion Polymer battery in their iPhones and iPod Touches. Unlike Nickel Cadmium, which were the battery of choice a few years ago do not have a "memory" when charging.
They also are rated based on charging cycles. A cycle is from fully discharged to fully charged. Most specification sheets for batteries today will have a cycle count that the battery can go through and keep as close to 100% charge as possible.
All batteries degrade over time, it just depends on the usage of the battery. The faster you go through charge cycles, the faster the battery will degrade.
Charging the battery all night is not detrimental to the battery, as they have a integrated charging circuit that allows them to be rapid charged to approximately full (90 to 99%), then they trickle charge from that point. The trickle charge is only to keep the battery topped off at 100% or so.
The battery does need to be cycled regularly, though, to keep in good working order, also. Most people recommend that you discharge the device at least once a month, or two weeks or even weekly (depends on who you ask). This allows the whole battery to be active, not just half or whatever is used on a daily basis.
Think of the battery as a glass of water. You fill it up with water and it is 100% full. You drink about half a day (discharge) and then refill it to full (charge). The half that you are not drinking on a daily basis becomes "stale." So every once in a while, you drink, or just empty the whole glass and refill to make sure all of the water is fresh.
Sorry for the long post.