From the point you hit "pick up" to the point you hit "drop off" I believe. They say you get paid for waiting at pickup also, but no way to verify unless you use a stopwatch and the ride is longer than a minimum ride.
It doesnt always update realtime. Sometimes (usually) it's about 30min behind. It's always done this.
Also it doesnt include time on destination filter.
If you are online at start of a new day (5am) and never go offline then the delay in counting your online time will be apparent.
I dont think you were asking this but trip duration starts as soon as the app shows that the pax is "picked up". The time the trip request was accepted is what is used to determine when the trip occurred.