A number of new PlayStation 4 owners have contacted IGN saying they're encountering the error numbers NW-31453-6 or NP-3500-8, along with text explaining "The network connection has been lost".
Sony responded to the issue on its support site and through Twitter. Though the response has been removed, as you can see below it explains that an extremely high number of people are trying to log on and download firmware 1.50 for their new console.
As soon as a PS4 is connected to the internet, it automatically connects to the PSN to download the new firmware in the background. Given how many people have purchased the new console, a blip like this was always fairly likely. Sony has confirmed it's working to resolve the issue, but with more consumers expected to pick up the console during regular shopping hours today, it's probably going to be another couple of days before things are back to normal.
If you're struggling to download the patch, you can always get it from PlayStation.com, put it on a USB stick, and use that to update the console. If that's not an option, Sony can provide Blu-ray discs with the patch on but it's likely the PSN will be functional again by the time that arrives.