Large-amplitude self-excited thermoacoustic oscillations arising due to the interaction between unsteady heat release and acoustic pressure fluctuations have been encountered in many thermal devices. These oscillations may lead to unwanted structural vibrations and efficiency reduction while emitting loud noises, and thus the predicting of such oscillations is very important. Physically, oscillation is a kind of instability, so stability analysis can be applied to understanding such a phenomenon. The present work focuses on the role of time delay between unsteady heat release and flow perturbation in the stability of thermoacoustic system. To this end, one-dimensional Rijke tube model with both open ends is numerically investigated. In the Rijke tube model, an electric heater is located at the first quarter of the Rijke tube and its unsteady heat release rate is modeled by an empirical model proposed by Heckl. Non-dimensional momentum equation and energy equation of the acoustic perturbation are derived and solved in time domain by using the Galerkin technique. The time evolution of the thermoacoustic oscillations with continuous increase in the time delay is calculated in two different acoustic damping cases, namely the heavily damped case and the weakly damped case, while other parameters are fixed. It is found that in both the heavily damped case and the weakly damped case, the system stability switches between stability and instability as the time delay increases, which is called stability switching and is a typical nonlinear phenomenon in a delay-dependent system. However, compared with in the heavily damped case, in the weakly damped case, the stability region is enlarged and the amplitude of the limit cycle oscillation is increased. Besides, in the weakly damped system, the dominating mode of system shifts in the first three modes instead of keeping in the first mode during increasing the time delay, which suggests that for the weakly damped system, the higher modes cannot be neglected and the system cannot be analyzed with a single-mode model either. Further, the bifurcation plots for the variation of the time delay for these two cases show that the system stability changes with time delay for a period of two, which is equal to the period of the first acoustic mode. As a conclusion, the results of present work indicate that the time delay between unsteady heat release and flow perturbations plays a critical role in generating thermoacoustic oscillations, and the findings of stability switching can help to understand the nonlinear phenomena in thermoacoustic systems.