For most cards, If the previous month you paid, by the due date, the total balance as of the billing date, then no interest is charged on purchases made that month if you pay the balance by the due date. (It must be the previous two months for some cards). See the answer by KeithB for an example of paying the total amount. The period for which you do not accrue interest is known as a grace period.
If you did not pay your balance in full by the end of the previous month, then interest starts accruing right away on new purchases. Cash advances and balance transfers normally start accruing interest right away regardless of whether your balance was paid in full (they don't have a merchant to charge a fee to, so they have to get paid from somewhere.)
The details vary from card to card, so you should read the terms of your card, and/or contact customer service to be certain.