When the temperature and the pH value of the surrounding is significantly beyond the optimum level, the enzyme would be DENATURED.
Denaturation occurs if the active site of the enzyme changes shapes, it can no longer bind into substrates therefore it cannot function anymore.
Usually when the temperature or pH increases, the enzyme won't denature at once. The active site slowly changes shape, decreasing the rate for chemical reactions. Denature is where until the active site completely changes that no more substrate can bind into.
Note that denature doesnt mean the enzyme dies, enzyme is not a living thing, even though it cannot function anymore.