Banks used to charge consumers billions of dollars per year in over-limit fees, but those fees are virtually extinct today, thanks in large part to the CARD Act, which placed limits on when and how much card issuers could charge customers for exceeding their credit line.
On those rare accounts that can still be assessed an over-limit fee, you can avoid them by not "opting in" to allow excess transactions and resulting fees. If you opt in to over-limit fees on an account that still imposes them, you generally can be charged up to $25 the first time you exceed your credit limit, and $35 for the second time within six months. The fee can’t be larger than the amount by which you exceeded your credit limit, and your card issuer can assess only one over-limit fee per billing cycle that you exceed your credit limit. You can opt-out at any time.
If you don’t opt in, or if your card issuer simply doesn't allow excess charges, a transaction that would put you over your credit limit would be declined. If the card issuer allows it to go through even though you haven’t opted in, it can’t charge you an over-limit fee.