Currently, the standard approach to building a geomechanical model for analyzing wellbore stability involves taking into account only elastic deformations. This approach has shown its inconsistency in the design and drilling of wells passing through rocks with pronounced plastic properties. Such rocks are characterized by the fact that when the loads acting on them change, they demonstrate not only elastic, but also plastic (irreversible) deformations. Plastic deformations have an additional impact on the distribution of stresses in the rock of the near-wellbore zone on a qualitative and quantitative level. Since plastic deformations are not taken into account in the standard approach, in this case the results of the wellbore stability analysis are based on incorrectly calculated stresses acting in the rock. As a result, it can lead to misinterpretation of the model for analysis, suboptimal choice of trajectory, incorrect calculation of safe mud window and an incorrectly selected set of measures to reduce the risks of instability. The aim of this work is to demonstrate the advantages of the developed 3D elasto-plastic program for calculating the wellbore stability in comparison with the standard elastic method used in petroleum geomechanics. The central core of the work is the process of initialization of the elasto-plastic model according to the data of core tests and the subsequent validation of experimental and numerical loading curves. The developed 3D program is based on a modified Drucker-Prager model and implemented in a finite element formulation. 3D geomechanical model of wellbore stability allows describing deformation processes in the near-wellbore zone and includes the developed failure criteria. The paper shows a special approach to the determination of the mud window based on well logging data and core tests by taking into account the plastic behavior of rocks. An important result of this study is the determination of the possibility of expanding the mud window when taking into account the plastic criterion of rock failure.