Best Answer - Chosen by Voters
The z-test is used when the population mean and population standard deviation are known for the original population. If you don't have this information, but instead have a sample data, you use the t-test. The z-test compares a sample to a population. The z-test and t-test can both be one-tailed or two-tailed. The t-test however can be performed for one sample, two independent samples, or two related/matched samples.
The two independent sample t-test tests a null hypothesis by comparing sample means of a control group and an experimental group sampled from the same population. Keep in mind, the sampling must be random. Your test then is a relative comparison between the two independent samples, rather than to the population (as in the z-test).
When you're looking at two related/matched samples, that just means that an observation from one sample can be paired/matched to another observation from the 2nd sample on a one-to-one basis. Matching should only be done when it's reasonable to expect the observations to depend substantially on the matching variable. Examples of matching variables are things like weight, age, etc.
When you're looking at matched samples, there's a special kind called repeated measures. This is when the same subject is measured more than once. In this case, each subject is their own pair. So, for example, there might be an experiment testing a pill on memory. So a person would take a memory test before and after taking the pill to see if their memory improved. After performing the experiment on numerous people, you would have two related sets of data (before and after taking the pill), but more specifically, a repeated measures experiment where each person is their own pair.
The calculations involved in a two related sample t-test is slightly different than the calculations needed in a t-test for one or two independent samples.
As for the p-value, it indicates the degree of rarity of the observed test result. Smaller p-values tend to discredit the null hypothesis and to support the research hypothesis. You can't even begin to look at the p-value until after you've performed the appropriate hypothesis test.