What is the condition for using a t-test or a z-test? | Eklavya Online

What is the condition for using a t-test or a z-test?

T-test is usually used when we have a sample size of less than 30 and z-test when we have a sample test greater than 30.