Have you tried running your phone in Safe Mode? When the phone is in Safe Mode, none of the 3rd party apps run (ones downloaded from the Play Store). If the screen blacks out normally in Safe Mode then you know that a 3rd party app is the cause and you can start to remove apps one at a time until the issue is fixed. If the issue still happens in Safe Mode, then a 3rd party app is not the cause and you can investigate further. It's a good starting point & has helped me find a few apps that were causing issues with my phones. Below are the instructions from the Verizon website, if you want to give it a try. Sometimes after running in Safe Mode & booting back to normal, you might have to re-enter passwords into some of your 3rd party (Play Store) apps.

Safe Mode - Motorola DROID Razr M

Safe Mode temporarily disables all apps that have been installed via Google Play. Performing this troubleshooting step is necessary to determine whether a 3rd party app is the cause of an Operating System / App issue. Safe Mode should always be performed prior to a hard (factory) reset.

Enable Safe Mode
Preferred method
1. Press and hold the Power button.
2. Select and hold Power off.
3. Select OK.
Allow several minutes for the device to power off and restart into Safe Mode.
Upon reboot, Safe Mode will appear in the lower left.

If it is due to being plugged in there is a setting where you can turn that off. I'll try to find it. I turned it off the other day and can't find it right now. Found it: Settings/ Developer options/ Stay awake(uncheck it).

If you are on a particular app and it does this, sometimes the app itself has settings to where the screen won't shut off. Sometimes that is a good thing if you are playing a game