You deposit a lump sum for a fixed term, often three months to five years, and the bank pays a fixed rate for that whole term. The rate is usually quoted as an APY, which already includes the effect of compounding.
Taking money out before the CD matures usually costs an early-withdrawal penalty, commonly a set number of months of interest. If you withdraw early in the term, the penalty can be larger than the interest earned and cut into your deposit.
CD interest is taxed as ordinary income in the year it's credited, even if you leave it in the CD. Bank CDs are FDIC-insured and credit union CDs are NCUA-insured, up to the standard coverage limits.