Specialization refers to a player's decision to invest a character's experience in only a few specific skills to train them faster and make the related abilities more powerful and reliable, rather than attempting to learn many different skills. Specializing is generally regarded as essential, since there is not enough experience in a normal game to advance more than a handful of skills to a high level. However, over-specialization can result in the character being unable to handle some of the challenges they face for lack of flexibility.
Benefits of Specialization
Specialization in a particular skill improves the power and reliability of that skill's abilities. For example, specializing in Conjurations magic makes it easier to cast the offensive spells in that school (from Magic Dart on up), and they will increase in damage. By comparison, focusing on a weapon skill like Long Blades increases your accuracy and attack speed, while the Armour skill increases your AC gains and decreases spellcasting/evasion penalties from heavy armour.
Drawbacks of Specialization
Over-specialization may result in difficulty dealing with certain challenges. It routinely affects spellcasters of all walks of life: for example, a Fire Elementalist who does not branch out into other schools of magic may have a hard time defeating monsters that are resistant or even immune to fire. Similarly, a melee character who completely eschews ranged combat skills will often be forced to rush through arrows and spells towards their opponent, or retreat for cover.
How to Specialize
Specializing is easy. Press the m key to access your Skills screen and see all the skills you currently know. These will be separated by spaces into four or five categories (Offensive, Ranged, Defensive, Magic, and Other). Pressing the key associated with a skill will toggle its training Off (dark grey), On (light gray), or Focus it (white) causing more experience to be allotted.
By default it will use Automatic Mode, which automatically adjusts experience division between skills based on use. You can also press / and swap to Manual Mode, for more control. In Manual Mode, experience is divided flatly between enabled skills, with Focus doubling a skill's percentage.
After adjusting the options to your liking, as you earn experience, your skills will automatically level according to your settings. Just remember that as you progress through the game, you will eventually gain entirely new skills. They will be toggled On by default if using Automatic Mode, or toggled Off if using Manual Mode.
In Crawl versions prior to 0.9, experience was gathered and spent gradually as you performed actions related to each Skill. It was much harder to avoid unintentionally training certain things.