A credit card comes with a credit limit, which you can use to spend as per your needs. You can only shop with a credit card where they are accepted. You repay the borrowed money later, when you receive a bill for the month.
Nowadays, most credit cards come with a facility called the Interest-free period. Also known as the grace period, it is the golden time during which the balances on credit card do not accrue any interest charges, provided the credit card holder repays the entire outstanding in full during the following credit card cycle. The interest-free period varies with every lender and is generally between 20 to 55 days.