An unexpected black screen on your iPhone is never a welcome sight, as this indicates a low battery or other malfunction. If you've just charged and are certain you're not low on power, the cause of your dark screen could have more sinister roots.
Your iPhone's iOS controls every aspect of your mobile device, and if this software is out-of-date or otherwise corrupted, it could trigger functionality issues such as an unpredictable black screen. Other software you install, including games and other apps, could affect proper operation and cause issues. If your black screen issue started soon after installing something new, that newcomer could be your culprit.
Even if you're sure your battery is full, power issues could still be what's causing the black screen. Dirty contacts prevent a good connection between your battery and phone, so even a full battery may appear low if your iPhone can't communicate with it properly. The battery itself could be faulty or damaged and run down quicker than normal.
Due to their mobile nature, iPhones are prone to damage from drops and bumps as you go about your day. An accidental drop to the ground or dunk into water can cause internal hardware damage, resulting in a black screen. The dark screen could appear immediately following the accident or a period of time after, sometimes making it difficult to link the two occurrences.
How to Correct
Before jumping to conclusions that your iPhone is on its last legs, try restarting it. Your mobile is just a mini-computer, and like all computers it needs rebooted every now and then to shake out the bugs. If this doesn't correct the issue, make sure your iOS version is up-to-date. Uninstall the last app or apps you downloaded before the issue started. Remove your battery and clean the contacts with a drop of rubbing alcohol on a cotton swab and replace the battery if you suspect it's faulty. Connect to iTunes, back up your phone and restore it to ensure a correct, uncorrupted iOS installation. If nothing seems to help, seek the guidance of the gurus at the Genius Bar nearest you.