I asssume you are looking at sample means of data drawn from a normal disrtribution for small sample size. If the population variance is known the sample means have a normal distribution and you should use the z-statistic, if the population variance is unknown and you estimate it from the sample then you use the t-statistic.

CB