One of the unfavourable factors of downhole pumping equipment operation at the fields at the final stage of development is high content of mechanical impurities in the pumped fluid. Similar problems are observed in fields with friable, weakly cemented formations, the fracture products of which flow downhole, resulting in lower extraction rates, equipment damage and higher operating costs. In oil production practice various technological measures and technical means are used to reduce the negative impact of sand penetration - regulation and optimisation of pumping equipment operation mode to ensure a rational rate of fluid withdrawal, application of technical devices in the form of sand filters and sand anchors and others. However, these measures and recommendations, for the most part, work successfully in the modes of continuous operation of wells. With the growing number of oil fields at the final stage of development, the issue of sanding becomes more and more urgent, as due to low flow rate wells at such fields are often switched to the mode of periodic operation, which favours the formation of sand plugs in tubing above the pump due to sufficient time for sedimentation of mechanical impurities. This can lead to pump jamming or rod breakage during subsequent well pump start-up. The experience of using sand filters (frame, slotted and others) in the arrangement of downhole pumps has shown that it does not always effectively solve the problem of sand penetration due to clogging of their cells with mechanical impurities and increased hydraulic resistance. This negatively affects the pumping equipment operation due to the shift of characteristics into the zone of suboptimal modes with associated problems for the electric drive. This makes it necessary to carry out underground well workover with removal of deep well pumping equipment for replacement or washing of the filter in surface conditions, as due to their peculiarities in the well pump layout (the filter is located at the intake of the pumping section), washing in well conditions is not always possible. These problems require not only the creation of effective downhole devices to prevent sand ingress to the pump intake or devices to prevent sand plugs above it, but also acceptable in practice calculation methods for predicting the sedimentation time of mechanical impurities in tubing or determining the minimum required speed of upward oil flow for stable sand removal. These calculation methods would also allow to reasonably regulate the time of technological interruptions while waiting for the wells to start up in periodic operation modes or to predict the time of activation of sand control devices for discharging the sand accumulated above the pump. This is the subject of this article. As a result of calculation analysis it was established that the main factors affecting the sedimentation process of mechanical impurities in the well are the speed and mode of fluid movement, its viscosity, density and size of the impurities themselves. Moreover, the most sensitive for the calculation accuracy is to take into account the change of fluid viscosity as it moves along the tubing as a result of heat exchange and the change of dissolved gas content due to pressure drop. Although at this stage the proposed methodology does not take into account some factors that can make additional adjustments to the process of sand sedimentation, however, it allows to predict with acceptable accuracy the time of technological interruptions in the well operation to prevent the formation of sand plugs, or the rational mode of operation of pumping equipment, providing the necessary speed of upward flow in the pipe for sand removal.