Leveling
Every time you level up, your character's attributes automatically increase. A completely naked level 1 night elf warrior, for example, has 19 strength, 24 agility, 22 stamina, 20 intellect and 20 spirit; at level 90, the same warrior has 212 strength, 137 agility, 188 stamina, 39 intellect and 67 spirit. The primary attributes for the character's class, in this case strength and stamina, increase at a higher rate than stats that are not very useful, in this case agility, or stats that are completely useless to a character, in this case intellect and spirit.
Equipping Gear
Most armor and weapons your character can equip have attribute bonuses, with the exception of ones that are very low level or purely cosmetic. The amount of attributes granted depend on both the item's level and its quality. The higher the item's quality, the better its stats, but a lower-quality item of a higher level will likely have higher stats than a higher-quality item of a lower level. For example, the Runed Copper Breastplate, an uncommon chestpiece with an item level of 18, adds 4 strength and 3 stamina, while the Flameseared Carapace, a chestpiece item of the same item level, adds 4 strength, 6 stamina and 4 critical strike. The Breastplate of Rescue, an uncommon chestpiece with an item level of 29, adds 7 strength and 8 stamina and is better than both of the lower-level ones.
Improving Gear
Several professions offer ways to improve items and increase the amount of attributes they give. Item enchantments can be crafted by enchanters, tailors, blacksmiths or leatherworkers and can be applied to any item, although they are restricted by that item's slot. For example, the Blurred Speed enchantment, which increases agility by 140 and also improves movement speed, can only be applied to boots. Cut gems created by jewelcrafters also exist, but can only be added to items that have sockets.
Temporary Buffs
Several buffs exist that increase your attributes temporarily with varying durations. Some of them are cast by players, such as Mark of the Wild, a druid buff which increases strength, agility and intellect by 5 percent. Others come from items crafted by various professions, typically alchemy and cooking. For example, Black Pepper Ribs and Shrimp, a type of food crafted by cooking, increases strength by 300 for one hour; Flask of Winter's Bite, a type of flask crafted by alchemists, increases strength by 1000 for one hour; Potion of Mogu Power, a type of potion crafted by alchemists, increases strength by 4000 for 25 seconds. Some buffs are mutually exclusive -- for example, you can only have the buff from one flask or two elixirs active at any one time. Most of these buffs disappear when you die, with some exceptions, such as flasks.