I am always so confused whether to do a chi square test or a t test in the sums given by my biostats teacher. Does anyone have a simple rule to decide this?
This is a very subtle question and I encourage you to read the Wikipedia articles on these different subjects (t-test, chi-squared test, p-value, etc) because the authors worked hard to combat common misconceptions about these commonly used statistical tests. Here is a rather oversimplified rule-of-thumb for these different tests:
I'd hate to have made a huge mistake, so please edit my answer and/or contribute your own if you think I am completely misrepresenting these topics!
As A.Kennard said t-test is applied when the random variable is normally distributed. How to know what is normally distributed is a relevant question. Regular measures which suffer some random error of measurement are normally distributed. The mean values estimated from different samples (the experiment that generates that sample may have any distribution) follow normal distribution. For e.g mean time interval of a radioactive decay- the interval itself is exponentially distributed but the mean of the mean decay interval will be normally distributed. You can reason that it is again an error of measurement that leads to variation in the mean value calculated in different samples. This is called the central limit theorem.
A normal distribution has two parameters- mean and variance i.e. you need to know these values beforehand to construct a normal distribution. A uniform distribution has no parameters- that doesn't mean that uniformly distributed samples have no mean or variance (in this case mean and variance are sample properties not distribution parameters). A t-test or z-test is done to see if a sample is a representative of a given normal distribution. That again means that the calculated mean and variance are equivalent to the corresponding distribution parameters. In case of z-test you know the population variance (distribution parameter). You may ask how can anyone possibly know the population variance beforehand. An example is a case in which you already know the error rate of your measuring device (may be provided by the manufacturer or interpreted from its design).
There are several variants of the $\chi^2$ test. But what is common between them is that they refer to $\chi^2$ distribution. Variances, which are always positive cannot be a normally distributed. These follow $\chi^2$ distribution. The F-test for variances uses the ratio of the $\chi^2$ statistic of the two random variables denoting variances. Even in the Pearson $\chi^2$ test, the test statistic is a sum of squares which makes it always positive. In fact this $\chi^2$ distribution is also used in t-test. As . Kennard said, one of the assumptions of t-test is that the population variance is unknown but assumed to be equal. Since population variance is unknown it has to be estimated from the sample. Like the case with all estimates you dont have a fixed value but a range of acceptable values falling in some confidence intervals. T-distribution is basically an average of several normal distributions with variance values falling in the allowed confidence interval of a $\chi^2$ distribution.
It is not necessary that categorical data are to be tested by $\chi^2$ test. Coin toss experiment gives rise to a categorical but it can be tested against a binomial distribution. So $\chi^2$ test can be used for categorical data but it is not the only test.
Its true that T-test are used when your dependent variable is Numeric and Chi-Square test is used when you are analysis categrical variable. But how about this:
You have a categorical response (0,1) to a campaign. 1 who bought the product and 0 who did not. If you sum up the responses in your Test group and Control group and devide them by thier respective population size, lets say you get something like this - .23% response rate in Test Group and .01% response rate in Control Group.
Can't you use T-Test to see if these reponse rates are different? If yes, then let me remind that these variables were categorical (0,1) but we still used them as numeric.
All I want to say is that if we are comparing response rates or percentages, then T-Tests can be used irrespective if the dependent variable is character or numeric.