The Basic card sets can be unlocked by playing in Play or Practice Mode. The cards are unlocked every two hero levels up to level ten. Beyond level ten, gold versions of some basic cards can be unlocked. Gold versions work the same but look cooler. :) Since basic cards are Soulbound (meaning they cannot be enchanted or disenchanted), these gold cards cannot be turned into a lot of dust. However, they allow you to have more than 2 of those basic cards in your custom card deck.
Hero experience is awarded whether you lose or win, although you get more experience for winning. Unlocking the Basic sets is easier in Practice mode since you don't have to face smart human online opponents with superior decks. Once you reach level ten with your hero though, experience gained in Practice mode is reduced, so you are better off making your own Custom deck for that particular hero and taking the fight online in Play mode.
You can see all the Basic cards in our Hearthstone Cards List.