As I recall some models of Samsung phones display the same message but many phones don't. My Nexus 5 does not and my LG tablet does not.
Modern phones use lithium batteries. It is important that these are not overcharged because this degrades the batteries by forming deposits of metallic lithium. However all modern phones will automatically stop charging as soon as the battery reaches 100%. So there is no danger associated with leaving the charger connected.
If you leave the charger connected the phone will go into a cycle of:
- stop charging at 100%
- run on the phone battery till the level drops to 9x% (the value of x depends on the phone)
- start charging again
- go back to step 1
However with modern batteries this won't have any effect on the battery life. I suspect the warning is just a throwback to the days when this sort of incremental charging could reduce battery life. Lithium batteries generally shouldn't be stored for long periods at 100% - that's why when you get a new phone the manufacturer will have charged the battery to around 50%. So I suppose you would reduce battery life if you left it on the charger for weeks at a time.