Workers’ isolation may occur in gig employment in the sharing economy, which generates a weak perception of the organization and unpredictable work performance. Drawing on social exchange theory, this paper proposes a framework to explore the effect of psychological contract fulfillment on gig workers’ task performance from the perspective of the mediation of organizational identification and the moderation of the length of service. A total of 223 samples were recruited from Didi (a ride-hailing company in China) drivers. The results show that both transactional and relational psychological contract fulfillment can directly affect gig workers’ task performance and also indirectly affect it via organizational identification. When the length of service for the current company is taken into consideration, transactional contract fulfillment, as the representation of a company’s recognition of gig workers’ effort, has a stronger effect on the organizational identification of gig workers who have been working for the company for less than a year compared with those who have been working for a longer period. The results show no difference in the relationship between relational psychological contract and organizational identification between the two groups. Transactional psychological contract fulfillment exhibits the same significant effect on gig workers’ task performance in both groups. By contrast, relational psychological contract fulfillment has a stronger effect on long-serving Didi drivers than on those who joined the company within the year. These findings generate certain theoretical and practical implications for gig employment management in the sharing economy.