The main difference between the three technologies is bandwidth.
Thunderbolt 3: 40Gb/s
USB-C 3.1 Gen 2: 10Gb/s
USB-C 3.1 Gen 1: 5Gb/s
This difference in bandwidth means that Thunderbolt 3 has the capacity for more displays to be hooked up to it than USB-C 3.1:
Thunderbolt 3: 2 x 4K displays, or single 5K display
USB-C 3.1 Gen 1 and Gen 2: 1 x 4K display
The greater bandwidth also means that Thunderbolt 3 can support external GPUs (eGPUs), something that isn't an option for USB-C 3.1.
Thunderbolt 3 also allows up to six devices to be daisy-chained together, while USB-C 3.1 doesn't support daisy-chaining.
When it comes to compatibility, Thunderbolt 3 is backward compatible with earlier Thunderbolt 2 and Thunderbolt devices, USB-C 3.1 devices, and USB 3.x and 2.x devices, as long as you have the right adapter. USB-C 3.1 works with USB 3.x and 2.x devices, but doesn't support Thunderbolt devices.
When it comes to cables, Thunderbolt 3 cables can be identified by the logo (hopefully) printed on the connector.