Numerous games have different mechanics which present a fixed list of categories for characters, such as "Fighter", "Wizard", and so forth -- ranging out to "Security Officer", "Outcast", and "Everyman". However, while the overt appearance can be similar -- the mechanics can work very differently. I would say that there are two broad groups of such mechanics. Note that I am defining my own terminology here, which matches with some games' usage but clashes with others'.
A Class system is primarily aimed at "niche protection" and/or continued differentiation of PCs. In many pure skill-based games, it is possible for all PCs to have decent levels in a set of core skills -- such as Dodge and Stealth, say. A class system discourages or prevents this by grouping skills and powers into distinct sets (i.e. "classes"). You choose one class (or perhaps a small set of classes) during character creation. From then on, it is easier to gain skills/powers within your class' set, and more difficult to branch out into other sets. This makes it harder to have redundant skills in the party, and thus emphasizes teamwork. To be effective, choosing a class is generally required during character creation, and it continues to have effect throughout later development.
A Template mechanic, on the other hand, is primarily a short-cut to make character creation faster. A pure template is just a pre-bought package of attributes, skills, and other capabilities in an otherwise skill-based system. Since it is just a time-saver, it may be an optional variant to a more complex point-buy system. After character creation, the template used is irrelevant -- there is no need to write down what template was used on the character sheet, for example.
Class and template mechanics are really aiming at different purposes. A key factor in how well they work, in my opinion, is the genre. Class systems are best suited for well-tread genres where there are enough stories and characters to clearly define trends. Because they define long-term niches for PC's, classes are more central to the game design and to the proper handling of the genre. Adding in new basic classes can greatly change the game design. Templates are a good option in new or loosely-defined genres where there is a bewildering range of possible PCs. The templates help players who are unsure of what they want to play, or who don't want to deal with complex tailored character generation. As a designer or GM, you can add or remove templates with little effect on the game design.
Certain genres have a lot of unique figures which are impossible or at least silly to model in either a class or template system. For example, Star Trek has a number of characters such as Spock, Data, Wesley Crusher, Odo, the holographic doctor, etc. Their uniqueness is integral to these characters. It would be silly to write up "Emergency Medical Hologram" or "Singh-type Android" as a class or race. Thus, I feel that a Star Trek game should have a free-form or point-constructed system which can generate such characters as PC's.
Some other genres have the opposite problem: characters are too similar. For example, many war movie genres are this way. The vast majority of main characters are soldiers whose core skills are extremely similar. Instead, main characters are distinguished by individual quirks and/or unusual features. You can deal with this by making most characters the same class, but then the class system loses its purpose. In other words, if you want characters to have heavily overlapping skill sets, then the class system can only work against you.
Of course, there are various mechanics which lie in between these two extremes. Class-based systems may range from "strict" systems which disallow any overlap, to "loose" systems which only make it slightly more expensive to get skills/powers outside of your class. Templates systems can also vary from nearly ready-to-play characters, to just a limited package of capabilities in a complex system. In the sections below, I will look at specific RPG systems and comment on how they fit into the above definitions.
In CoC, you are required to choose an "occupation" during character creation which effects your starting skills. Two-thirds of a character's initial skill points (on average) must be in the 8 or so skills of your occupation. However, one of the occupation skills is a choice of any skill -- and you may freely spend the other one-third of your skill points. In addition, your occupation has no effect after character creation.
This guides character creation by limiting the grouping of skills, but only slightly. It does very little to enforce niche protection or teamwork. Especially since it has no effect after character creation, I would tend to call it more of a background choice or at most a very weak class system.
In Cyberpunk, you are required to choose a "Role" during character generation. Choices include Rockerboy/Rockergirl, Solo, Cop, Netrunner, Fixer, Nomad. After character creation, your Role is fixed. However, the sole effect of the Role is that it provides you with a single special ability which is only available for members of your Role. For example, Solos have the special ability of Enhanced Initiative. Characters of other roles can freely buy up their combat skills and be better than a Solo at shooting/fighting/etc. However, only Solos can ever have Enhanced Initiative.
This is clearly a class mechanic in my nomenclature. It does not save significant time in character creation, and it enforces a limit throughout the life of the character. However, it is a very loose class system, in that it only affects the special abilities which are not always central to the game. For example, whether you are a Netrunner or a Solo has no effect on your gun skill.
In D&D3, you are required to choose a class during character creation. With experience, you can add a level to your original class or add 1st level in a new class. Thus, you can become dual or multi-classed at any time. However, multiclassing in this way may impose a experience penalty. More importantly, you almost always gain more by increasing your primary class. i.e. Going from 9th to 10th level in a class gives you more capabilities than going from 1st to 2nd level.
Since the system encourages sticking to your initial class or classes, it is still "class-based" in my nomenclature. Since you still have to distribute skill points and select advantages, the classes do not particularly save time compared to skill-based system (i.e. it is not very template-like). The class system is fairly loose in that you can branch out into other classes to a limited extent. However, there are benefits of sticking to a class: i.e. special abilities that come at higher levels. These act to discourage multiclassing, especially for spellcasters.
In Rolemaster, you are required to choose a class at character creation time which is more-or-less permanent. However, your class only determines the cost to raise different skills and spell lists. i.e. A wizard-class character can buy up nothing buy weapon skills, but the cost to do so would be much more than what a fighter-class character would pay for the same benefit. The system is purely skill-based in that all of your rolls are based on skills. Class only modifies the cost of acquiring skills.
Here the class system clearly acts to protect niches. Cost differences between classes are pretty major -- i.e. a Magician character pays 9 points for +1 weapon skill, while a Fighter pays only 1 point. This system actually adds an extra layer of complication onto buying skills, thus slowing down character creation (i.e. it has the opposite effect of template systems).
In V:tM, you are required to choose a clan. This has an effect on your background and social ties, but mechanically it only influences the cost of buying supernatural abilities (both during character creation and with experience). It costs (Current Level x 3) XP to raise clan disciplines, and (Current Level x 5) to raise non-clan disciplines. This is a class system by my nomenclature: your clan permanently affects your discipline costs. It is loose in that it only affects supernatural powers, and the cost difference is not as large as in some games. On the other hand, vampiric powers can be quite central to a campaign in the genre -- and it is nearly double cost.
As a side note, the looseness of the class system varies in other World of Darkness games. For example, in Mage: The Ascension the cost of raising spheres is only 6/7 for within-tradition and non-tradition spheres, respectively. This is noticably looser than the 3/5 ratio of V:tM.