When we use a z-test, we know the population mean and standard deviation. When we use a t-test, we do not know the population standard deviation and thus must estimate this using the sample data that...
When you don't have the population standard deviation, but do have the sample standard deviation. The Z score will be better to do as long as it is possible to do it.