The second-mentioned approach is typical to Sandbox MMOs (OSRS is a great example), while the first works the best in Themepark games, like WoW or Guildwars. The less common, but "classic" (in a sense that it was utilized in some of the oldest games in the genre and then forgotten just to be reintroduced) solution forgoes the idea of classes altogether and lets players become whoever they want. In the standard systems, classes are divided into three main categories (Tanks, Healers, and Damage Dealers), players get to choose a class that they would like to play as and are stuck with their choice unless they want to make an Alt.
A class system often becomes a foundation upon which the success of an MMORPG is built.