For physical gift cards, enter the number during checkout, see the link just below the promo code box (might be different in different countries). Any balance left over from the purchase gets added to your store credit.
For eGift cards the full balance is added to your store credit as soon as you accept the gift.