If the mean, mu, and standard deviation, sigma, of the population from which the sample is drawn under the null hypothesis are known, then the z statistic (on the left) can be used. If the mean, but not the standard deviation, of the population from which the sample is drawn under the null hypothesis is known, then the t statistic must be used.
The z and t statistics indicate how far the sample mean lies from the mean of the sampling distribution of means, in standard deviation units. This is an estimate in the case of the t statistic because the standard deviation of the sampling distriubtion of the mean must be estimated from the sample data.