Z170 is newer than X99. There are a couple of fundamental differences in the chipset. With X99 the CPU has either 28 or 40 PCIE lanes available for devices such as GPUs, sound cards, PCIE storage, etc. With Z170 the CPU has 16 lanes available, however, over 20 lanes (I forget the exact number) of PCIE are available from the chipset itself, unlike X99 where no PCIE is available from the chipset.
Otherwise interconnectivity is pretty similar. Z170 offers up to 4 core CPUs. X99 offers up to 10 core CPUs. Of course, a 10 core i7 costs a lot more than a 4 core i7.
Z97 is the last generation of consumer level board, before Z170. It is similar to Z170 except that it has far less PCIE connectivity coming from the chipset, and has more limited USB connectivity. Also, newer features like full blown M.2/NVME and USB 3.1 type C are not abundant on Z97.
Are you a content creator? Intensive video and photo editing? Intensive 3D modelling? Need to run 3 GPUs along with additional cards? X99 is for you.
Are you an average user? Do you just want to do some simple work, browse the web, do moderate level work (as described above) and play games? Z170 is for you.
There are other chipsets you have not asked about, such as H170. The most significant difference between Z and H boards is that H boards do not offer overclocking while Z boards do. All X boards offer overclocking as all X99 CPUs are unlocked.