Re: bought a htc m8
It will ship with what's known as a storage charge, probably between 50 75%. The manual will tell you how long to charge it initially. I don't remember how long that is, but I wouldn't worry about being exact as long as you get the green light in the top speaker grill telling you it's full.
After that initial charge, you'll want to treat it right for the best life since it's not a user replaceable battery. The recommended practices are to charge it once it gets around 40%, and unplug it once it's full. It's not recommended to continually drain the battery to zero or to leave it fully charged for long periods (I.e. Plugged in overnight). Lipo batteries like a happy medium and long term high and/or low charge levels speed up the chemical degradation that causes lost capacity. This is also why it's shipped with only a storage charge amount.
On a related note, this phone is capable of charging with a Quick Charge 2.0 charger. It's shipped with a regular charger at 1.5A rating. A Quick Charge 2.0 charger can change at higher amps and voltages for very fast charge times on QC2.0 certified devices. Not to be confused with marketing buzz words like fast charger, turbo charger, quick charging, etc. If you wish to make use of the faster charging, look specifically for the Qualcomm Quick Charge 2.0 label. It's great for quick boosts but will heat up the battery more. If you don't have a way to keep it cool, it will start to lower the charge amount to protect the battery from damage. They don't like heat as well.
High temps and high charge levels can really do a number on a battery's life.