Step 1: Go to https://www.xbox.com
Step 2: Login to your account
Step 3: Hover over your account link (the top right of the screen) a menu will appear, click on the "Redeem Code" button.
Step 4: On the next page, click "Redeem"
Step 5: Enter your code
Step 6: Click "Confirm"
Step 7: Click "Confirm" again to assign the key to your account.