You should be able to use any GPIO pin that is free. Ideally you need two pins for each encoder, or three pins if you need to use the push switch on the encoder as well.
If you don't have enough GPIO pins spare then you could use a multiplexer chip to increase the number of available pins. A multiplexer converts a large number of input lines into a small number of output lines using digital logic. There is a good tutorial on how they work at https://www.tutorialspoint.com/digital_circuits/digital_circuits_multiplexers.htm
If you use a multiplexer then you will need to find one that works at 3.3V to make it compatible with the GPIO port. Something like a CD74HC4051 would probably do the job. The 74HC4051 multiplexer converts 8 inputs into three outputs plus an enable pin to turn the multiplexer on and off so you could read four encoders using four GPIO pins. Basically the 8 inputs would create a 3 bit binary number on the three GPIO pins so by looking at the 3 bit number you can work out which of the 8 input pins are high and low and from that work out which encoder is currently being turned. You could wire up several multiplexers in parallel with all of the S0, S1 and S2 pins connected to the same GPIO inputs and each enable pin connected to a seperate GPIO output. That way you can turn each enable pin on in turn and read the inputs from that multiplexer. This would allow you to add an extra four encoders for only one extra GPIO pin.
You would need a program to continuously monitor the GPIO pins so you don't miss any changes on the encoder inputs.
The multiplexer method is more complicated than wiring the encoders directly to the GPIO pins but it does mean you can use more encoders with only a few GPIO inputs.