Hi Dearq,
Welcome to the Apple Support Communities! Sorry to hear you are having these issues with your new iPhone. I'm sure we can help you figure out what is going on, but we may need a bit more detail on what exactly you are seeing. Any additional info you can provide could be useful:
1. Can you describe the screen flash a bit more? Is it the backlight going on and off, is it showing the main screen or the lock screen, etc? Does it just flash once or twice, or does it flash rapidly?
2. Did this issue start recently, or has it been going on since you got your iPhone? If it started recently, did anything change around that time (any new apps, settings, updates, etc)?
3. Does this happen when you lock the screen with the Sleep/Wake button, when the screen automatically locks itself after an idle period (adjustable in Settings > General > Auto-Lock), or with both? Are you having any issues when waking your iPhone with the Sleep/Wake button?
Thanks!