How to measure time of this part of the graph

Hi guys
Im quite new here, sorry if this is a noob question, please refer me to any tutorial that cover this topic
I have a sensor recording data on a InfluxDB, and a simple query of that table
The graph looks like this

I need to measure the time
from max temp of the las 4 hours
until a drop of 50 of that value

Is there a way to do it?