You have a Z170 motherboard so you could go all the way up to a 6700K.
But then your CPU would be far superior to all of your other hardware and you would eventually be buying a new GPU and a new 16GB kit of RAM to make everything more updated.
But to simplify the answer to your question you can go up to a 6700K and anything in between.
While the list may say that you can go up to a 7700K, that is only with a BIOS update to the latest version, and while it supports 7th gen, you're not going to get the most out of a 7th gen unlocked CPU with a Z170 plus it would cost quite a bit of money for one as well, which is why a used 6700K would be totally fine.
I'm currently rocking a 6700K overclocked to 4.6GHz with a 1080 Ti with no issues or serious CPU bottleneck.
The only time I see a near 100% usage on my 6700K is if I play Assassin's Creed Origins on max or near max settings at 1440p
Here's a list of all the supported CPU's
https://www.gigabyte.com/Motherboard/GA-Z170X-Gaming-6-rev-10#support-cpu