Rock is a natural geological material; its time-dependent failure presents complex nonlinear and random characteristics under the interaction effects of various mechanisms. Previous research focuses on either short-term or long-term failure behavior. Here, we develop a new unified numerical model to address short-term and long-term rock failures in one framework. Viscoelastic, viscoplastic, and damage mechanisms are considered and integrated under thermodynamic consistency. The corresponding parameters feature definite physical meanings. Mean-field homogeneous (HO) analysis and mesoscale-based heterogeneous (HE) analysis are proposed. Numerical schemes are validated via several representative examples. In both short-term and long-term situations, the proposed model can reproduce and predict time-dependent failure behaviors (such as the failure mode, strength, and failure time). Rock failure is controlled by various energy dissipation components and exhibits prominent time-dependent characteristics at different time scales. The effect of mesoscopic details sustainably enlarges as time prolongs. Furthermore, the fluctuation in material properties at the mesoscale profoundly affects the macroscopic nonlinear, stochastic, and discrete behavior. Our research provides insights into time-dependent rock failure and catastrophe forecast.