If you enable Stay Awake mode on HTC One, then the screen will never sleep if you plug it to a charger. To learn how to keep HTC One screen while charging, do as follows:
1. Open "Settings" app
2. Tap "Developer Options"
3. Mark "Stay Awake"
If you want to change the setting of display time out, see: How to Change Screen Time Out on HTC One