Some additional information if you're interested:
APR vs. APY: How the Distinction Affects You
Compound interest - Wikipedia, the free encyclopedia
As a quick primer, the whole idea is that a lender (could be a bank or an investor, which could be you) lets a borrower (could also be a bank, a business, or you) use a certain amount of money for a specific period of time. In return for being allowed to borrow money, the borrower pays the lender interest.
The interest rate charged for this period is called the "periodic rate". Typically it's somewhere between 5-30% for most normal consumer loans.
The period itself is determined by the loan agreement. Like said above, the period could be days, weeks, months, quarterly, 6months, annually, etc.
The only catch is a lot of financial institutions will use some obscure formula to calculate the balance for the period.
Suppose your period is 1 month, and you make 3 deposits during the month. Some bank may use the lower balance, which may be $0 if you didn't deposit anything for the first part of the month. Some will use an average daily balance where they take the outstanding balance for each day, sum up the daily balances, and take an average. Some may use a weighted formula.
Either way, the "periodic balance" X the "periodic rate" = interest earned for that period.
The idea of an APR (annual) is to normalize periodic rates for different periods so that you can compare the interest rate for different loans. For example, a monthly 1% rate = 12% APR. A quarterly 3% rate = 12% APR.
Both of these loans look the same, and in some cases, they could very well be.
For normal consumer loans, banks typically calculate a daily periodic rate and use that rate to calculate a daily interest and add that to the balance.
The idea of taking the daily rate X 365 = APR is because the daily rate is around 0.00001625% or something like that. Most consumers won't have any idea how to compare a number that small. When you're dealing with 5-30%, most people can comprehend this range of numbers much better.
The APY really only applies to investors. What happens at the end of a period is that the interest is added to the balance of the account, and the new balance is used to calculate interest for the next period.
The APY takes into account interest on the interest, i.e. compound interest.
For example, if your quarterly rate is 3%, and you deposited $100 at the beginning of the year and forget about it, you account would look like this (assuming no fees and no deposit/withdrawal):
End of quarter 1: $103
End of quarter 2: $106.09
End of quarter 3: $109.27
End of year: $112.55
As you can see, you got $12.55 in interest. That's a little more than 12% of $100 because you got interest on the interest of 1, 2, and 3rd quarters accuring for 3, 2, and 1 quarters, respectively.
The actual APY for this case is 12.55%, a little higher than the 3% quarterly rate X 4 quarter = 12% APR.
As disneysteve said above, since you are the lender, you can pull money out or put more money in whenever you want. Your actual APY is determined by how much money you have sitting in the account. The APR is just used to calculate the periodic rate to determine how much interest you earned for a period.
Take the 3% quarterly rate example above, say you put in $100 in the beginning at the year, but halfway through the year you withdraw $50. Your account looks like this:
End of quarter 1: $103
End of quarter 2: $106.09 - $50 withdrawal = $56.09
End of quarter 3: $57.77
End of year: $59.51
In this case, you only earned $9.51 in interest. You had $100 for 6 months, the you took out $50 and left the rest for the remaining 6 months.
In this case, your net gain in only $9.51. The APY is still 12.55% because APY is estimated from the periodic rate and the number of periods in a year.
Note that using APY to value an investment is a little deceptive because APY doesn't take into account the periodic balance. From the example above, you can see a drastic change in the returns if your balance changes ($12.55 dropped to $9.51 due to midyear withdrawal).
Like said above, I prefer to work off of a daily periodic rate since this is how most simple interest loans work. At the end of a day, whatever the outstanding balance is on the loan, minus any payment processed, multiplied by the daily periodic rate and added to the balance as the beginning balance for the next day. Repeat until the loan is paid off.
When dealing with an investment account, make sure you read all the fine print because each bank will try to use some obscure formula to get more money from you.