While the IP system allows for about 4.3 billion addresses, not all of those are available to actual devices. There are some that are designed for private network use, so a router can assign them without worrying that it is blocking traffic to some external resource. Another big drain was wasted addresses, where organizations would purchase a big chunk of the public address space and use a tiny fraction of it. Beyond that, we just have a lot of devices, from cell phones, to home networks, to the servers they contact. Microsoft is trying to reach a billion devices with Windows 10, and the vast majority of them are expected to be online.
I'm mentioning it now because the American Registry for Internet Numbers (ARIN) announced that they will be unable to fulfill some requests for IPv4 blocks. All they have left at the moment are /23 and /24 chunks, which are bundles of 512 and 256 public addresses. As of the time of publishing, 46 chunks of 512 and 431 chunks of 256 are available, which is 133,888 total public numbers.
Of course, it's not as simple as saying “let's move to IPv6 then”. There will be some pain when the switch happens. For instance, Unreal Engine 4 has only been IPv6-compliant for a year, with the launch of Unreal Engine 4.2 in June 2014. This poses a significant problem for older games that rely upon IPv4 addresses for multiplayer, and that doesn't even consider other online software.