Naturally fractured formations usually have strong heterogeneities. Drilling and production operations in such formations can involve unwanted formation failure risks such as wellbore collapse and wellbore fracturing. This study presents a coupled thermal-hydraulic-mechanical numerical model for near-well stress evolutions during drilling in naturally fractured formations. The evolution of pressure, temperature, and geo-mechanical responses on the wellbore wall and in the near-well region is simulated. The effects of wellbore pressure, internal friction angle, and natural fracture length on formation rock risks are discussed. A failure index is used to quantify the formation rock failure risks. The existence of natural fractures magnifies the heterogeneous system response induced by drilling. Increasing the wellbore pressure from a relatively low value can improve the support for the wellbore wall, which reduces the failure risks caused by shearing. In mechanically weak formations, the effect of natural fractures on formation rock failure becomes more significant. When the natural fracture length is large, the near-well region tends to have greater failure risks as the formations become more mechanically weak. This study provides a quantitative understanding of the effects of drilling and formation parameters on failure risks.