Blizzard is introducing a progression system to Starcraft 2 starting with the next Heart of the Swarm beta patch. Don't freak out, though: the game isn't getting an RPG overhaul or anything -- you'll simply earn portraits, decals, and be able to show off how much you've leveled up each race (the cap is 20).
Experience is earned in matchmaking modes and through custom games on Blizzard maps. Specifically, it's added to your total when you build a unit or destroy a building, and it's all awarded at the end of a match. There will also be various alternative ways of earning experience, like playing with friends.
"We’re planning on making adjustments over time," says Blizzard, "So it’s likely that XP resets will happen during beta. We’re going to pay very close attention to the leveling curve and the fun factor of this system, so it’s important that we have a lot of playtest results to work with. We’ll give beta testers notice in advance of resetting the system so testers can help us try different methods of gaining XP.