To more precisely answer your question, Z170 has 20 PCI-E lanes at max independent of the ones hosted by the CPU. The CPU and PCH connect via a DMI 3.0 interface on all of the boards with the exception of the H110 board, that uses the older DMI 2.0 interface. This is equevilant to roughly a PCI-E 3.0 x4 connection, but it does not consume any PCI-E lanes from the CPU or motherboard.
The chipset uses what are known as HSIO lanes, which are essentially the same as PCI-E 3.0 lanes to connect to virtually everything else. A good example of what is going on here is to compare it to graphics cards. In the past, like the Voodoo 2, there were a ton of different components and fixed function units used to handle the various tasks. Eventually, most of these pieces were replaced when graphics cards moved away from fixed function units to general use shaders (I.E. CUDA/Stream Processors/Pixel Shaders). Chipsets are experiencing much the same thing, as Intel moves away from creating a chipset that contains controllers for SATA-III, SATA-II, USB 3.0, USB 2.0, PCI-E etc. to a multi-purpose controller unit capable of running all of these.
Z170 chipset has 26 of these, six of which are hard coded to be USB 3.0, with an additional 4 that can be configured as USB 3.0. The USB 2.0 slots do not consume any HSIO lanes. Of the 26, if all potential USB 3.0 lanes are used that leaves us with 16 HSIO lanes remaining (or 20 at most).
Z170 also supports up to 6 SATA-III connections that also consume one HSIO lane each. If all of these are configured and in use, then the motherboard now only has 10 HSIO lanes remaining (or 20 at most assuming no SATA points and no additional USB 3.0 above the initial six.)
You drop an additional HSIO lane for a single LAN NIC, leaving 9 HSIO lanes.
Of these remaining 9 lanes, all of them are essentially PCI-E 3.0 lanes, and can be configured into x1, x2 or x4 configurations. Any additional on-board features such as extra USB 3.0 or 3.1 slots, additional SATA ports, or secondary networking devices further reduce this number by at least one.
So, long story short, Z170 has at most 20 PCI-E 3.0 lanes available, if the motherboard OEM decides to not configure any HSIO lanes for anything and sells you a motherboard without any SATA ports, additional USB 3.0 ports, networking capabilities, or any other additional similar features.
As no motherboard OEM is going to do that, however, you likely have 9 PCI-E 3.0 lanes or less on a Z170 board. Often, you will see motherboards that have far too much connectivity like this one from ASRock:
http://www.tomshardware.com/news/asrock-fatal1tyz170-pr...
In which case, the motherboard has several of the connectivity interfaces shared with other devices, and just about anything you connect to the motherboard disables something else.As for the 16 lanes coming from the CPU, those are still reserved for GPUs typically.