Generally the way credits work in TV shows is that the most important characters within the show will appear in the credits first - these actors are said to have "top billing" and their roles within the production will be significant. These will be followed by less important/not so well known supporting characters. At the end of the credits there may be a few additional actors who while their role in that particular work might not be significant, are generally better known actors than all of the other actors on the list (unless you've got somebody A list for your leading roles, that is).
For example, using NCIS, you have the main team members from the Major Case Response Team (Mark Harmon as Gibbs, Michael Weatherly as DiNozza, Pauley Perrette as Abby, Sean Murry as McGee), then your supporting characters like Brian Dietzen (Jimmy Palmer) and then the credits end up with David McCallum as Donald Mallard. David McCallum has a much longer career but a much smaller part yet his name is seperate from the rest of the cast and appears at the end of the credits.
It is also possible for some actors playing small parts to appear first in the credits, this is usually down to these actors being very well known in comparison to the rest of the cast, or for contractual purposes. The example given in the Wikipedia article for Billing in Film-making uses the example of Marlon Brando and Gene Hackman both being credited before the title in Superman (1978), while a then unknown Christopher Reeve (who played Superman) was not.