Is it a bad idea to let your phone keep charging all the time?

I read somewhere that long charging periods can be harmful to the battery and that the best level to maintain it is around 50%. Is this true?

If so, after how long will the battery show signs of being affected?