The global shale gas resources are huge and have good development prospects, but shale is mainly composed of nanoscale pores, which have the characteristics of low porosity and low permeability. Horizontal drilling and volume fracturing techniques have become the effective means for developing the shale reservoirs. However, a large amount of mining data indicate that the fracturing fluid trapped in the reservoir will inevitably cause hydration interaction between water and rock. On the one hand, the intrusion of fracturing fluid into the formation causes cracks to expand, which is conducive to the formation of complex fracture networks; on the other hand, the intrusion of fracturing fluid into the formation causes the volume expansion of clay minerals, resulting in liquid-phase trap damage. At present, the determination of well closure time is mainly based on experience without theoretical guidance. Therefore, how to effectively play the positive role of shale hydration while minimizing its negative effects is the key to optimizing the well closure time after fracturing. This paper first analyzes the shale pore characteristics of organic pores, clay pores, and brittle mineral pores, and the multi-pore self-absorption model of shale is established. Then, combined with the distribution characteristics of shale hydraulic fracturing fluid in the reservoir, the calculation model of backflow rate and shut-in time is established. Finally, the model is validated and applied with an experiment and example well. The research results show that the self-imbibition rate increases with the increase in self-imbibition time, and the flowback rate decreases with the increase in self-imbibition time. The self-imbibition of slick water is the maximum, the self-imbibition of breaking fluid is the minimum, and the self-imbibition of mixed fluid is the middle, and the backflow rates of these three liquids are in reverse order. It is recommended the shut-in time of Longmaxi Formation shale is 17 days according to the hydration and infiltration model.