The coal pillar is an important structure to control the stability of the roadway surrounding rock and maintain the safety of underground mining activities. An unreasonable design of the coal pillar size can result in the failure of the surrounding rock structure or waste of coal resources. The northern Shaanxi mining area of China belongs to the shallow buried coal seam mining in the gully area, and the gully topography makes the bearing law of the coal pillar and the development law of the internal fracture more complicated. In this study, based on the geological conditions of the Longhua Mine 20202 working face, a PFC2D numerical model was established to study the damage characteristics of coal pillars under the different overlying strata base load ratios in the gentle terrain area and the different gully slope sections in the gully terrain area, and the coal pillar design strategy based on the fractal characteristics of the fractures was proposed to provide a reference for determining the width of the coal pillars in mines under similar geological conditions. The results show that the reliability of the mathematical equation between the overlying strata base load ratio and the fractal dimension of the fractures in the coal pillar is high, the smaller the overlying strata base load ratio is, the greater the damage degree of the coal pillar is, and the width of the coal pillar of 15 m under the condition of the actual overlying strata base load ratio (1.19) is more reasonable. Compared with the gentle terrain area, the damage degree of the coal pillar in the gully terrain area is larger, in which the fractal dimension of the fracture in the coal pillar located below the gully bottom is the smallest, and the coal pillar in the gully terrain should be set as far as possible to make the coal pillar located below the gully bottom, so as to ensure the stability of the coal pillar.