How long do you spend on one machine in the gym before moving on to the next machine?
It depends on what your target is. Are you trying to shred or bulk? Are you trying to improve endurance, or strength or power?
The answer to any of these questions will determine the number of sets and reps as well as how long you rest between sets. It also determines how much time under tension you want and hence how long each rep is going to be. Last but not least, how many exercises can you do on this one machine?
Depending on all that, it can take you anything from a few min to about half an hour.