Do you mean in a hazard?
For Training level, you have to go through A-B-C, in that order. Other gates are 'dead' for you--they do not exist. No cantering(or, well, 5 seconds of break to cantering at most), and not timed for penalty points. But if you are in the hazard more than 5 minutes you are eliminated.
For Prelim level, you have to go through A-B-C-D, in that order, and it is timed. You may canter/gallop. Same 5 minute rule applies here.
Out on the marathon course, you can have as many gates as the course designer wishes, but it generally ranges between 10-50 out here.
Hope I answered your question!