Is this while the phone is on the homescreen, or has an app open? Some apps will hold the device awake while the app is active--like e-reader or video player apps, for example.
Have you double checked the screen timeout in Settings/display. Also Settings/general/ check battery and apps. In battery touch the battery discharging to see what has been using power and under apps check running to see what is open. Possibly an app open in the background also check under display to see if face detection or daydream is on. Also have you tried turning the phone off and back on.
Steve/Boanerges Performance
Have you enabled Developer Options? If so, check in there to ensure that "Stay Awake" isn't enabled. That could be why it doesn't shutoff when you are plugged in.
Didn't you say that the screen was also staying on even when not on charger? I didn't think that setting would affect the screen if it was off charger.
Posted via Android Central App.
Please excuse any typos or autocorrect derps.