Interest is added to the principal at each compounding period, and the next period's interest is calculated on that larger amount: A = P(1 + r/n)^(nt).
What compounding frequency should I choose?
Use the frequency your bank or investment uses. Commonly this is quarterly for fixed deposits and monthly for savings. More frequent compounding grows money slightly faster.