When a ticket is newly created on the portal, the default status of this ticket is "open." So this is when the SLA timer begins on the ticket and the time gets calculated on the ticket. The response time and resolution time on a ticket are determined by the SLA policy applied to this ticket and the details of this could be checked in Admin ->Workflows -> SLA policies.
When you reply to a customer or wait for a third party to give you information, you could change the status to pending or "waiting on third-party response." The SLA timer could be switched off for such statuses in Admin -> Workflows -> ticket fields -> click on the status dropdown to toggle off the respective times next to these statuses.