You get credits based on how many nights you stay at your resort. You get all the credits when you check in, and they are good until midnight of the day you check out. If you have any credits left on the last day, you may use them.
If you have two adults on the regular dining plan and are staying 5 nights you will receive a combined total of 10 adult TS, 10 CS and 10 snack credits to use in any combination over the length of your stay.
You may want to read through the first posts of the Everything You Always Wanted To Know sticky thread at the top of this forum.