In this work, we study the prospect of detecting the stochastic gravitational-wave background with the TianQin Observatory. We consider sources of both astrophysical-origin and cosmological-origin, including stellar-mass binary black holes, binary neutron stars, Galactic white dwarves, inflation, first-order phase transitions, and cosmic defects. For the detector configurations, we consider TianQin, TianQin I+II, and TianQin + LISA. We study the detectability of stochastic gravitational-wave backgrounds with both the cross correlation and null channel methods, and present the corresponding power-law integrated sensitivity curves. We introduce the definition of the "joint foreground" with a network of detectors. With the joint foreground, the number of resolved double white dwarves in the Galaxy will be increased by 5$-$22\% compared with a simple combination of individual detectors. The astrophysical background is expected to be detectable with a signal-to-noise ratio of 100 after 5 years of operation and dominated by the extragalactic double white dwarves. On the other hand, due to the uncertain nature of underlying models, we can only estimate the detection capability of the cosmological background for specific cases.