How do we decide whether to use a z test or a t test when testing a hypothesis

How do we decide whether to use a z test or a t test when testing a hypothesis about a population mean?

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now