Positive social relationships are vital for mental health. There is an ever-increasing understanding of the cognitive and computational mechanisms that underlie how we process others’ behaviours during social interactions. Yet fundamentally many conversations, partnerships and relationships have to end. However, little is known about how people decide when to leave. Theories of decision-making posit that people stop a behaviour in favour of another based on evidence accumulation processes, shaped by the value of alternative behaviours (opportunity costs). Do people compute evidence to leave social interactions based on the opportunity costs of connecting to others? Here, in a novel economic game, participants made decisions of when to leave partners in social environments with different opportunity costs for moving on. Across four studies we find that people leave partners more quickly when the opportunity costs are high, both in terms of the average generosity in the environment and the effort required to connect to the next partner. People’s leaving times could be accounted for by a fairness-adapted evidence accumulation model, with a lower threshold for leaving in high opportunity cost social environments. Moreover, decisions to leave were modulated by depression and loneliness scores, which were linked to an interaction between the fairness of a partner and the opportunity cost of the social environment. These findings demonstrate the cognitive and computational processes underlying decisions to leave social interactions, and highlight that loneliness and depression may be linked to an atypical dynamic allocation of time to social interactions.