After an agent closes the lead, I want the chat to disappear from them so another agent can take the customer. Possible?
Yes: Chat rules → Hide closed, with a number of days (0 = immediately); applies to the Department and Only-my-records levels.
Yes. In Settings → Chat rules → Hide closed turn the rule on and set after how many days a closed lead or deal stops giving visibility; 0 means the chat disappears the moment the record is closed. The rule applies to employees on the Department and Only my records levels; administrators and the All level keep seeing the conversation.
A second switch, Ignore the contact's responsible, is usually needed too: without it, a contact assigned to the same agent keeps the chat visible even after the lead is closed. When the customer writes again and a new lead is created, the conversation appears for the new lead's responsible.