We study the behavior of direct limits in the heart of a t-structure. We prove that, for any compactly generated t-structure in a triangulated category with coproducts, countable direct limits are exact in its heart. Then, for a given Grothendieck category G and a torsion pair t = (T , F) in G, we show that the heart Ht of the associated t-structure in the derived category D(G) is AB5 if, and only if, it is a Grothendieck category. If this is the case, then F is closed under taking direct limits. The reverse implication is true for a wide class of torsion pairs which include the hereditary ones, those for which T is a cogenerating class and those for which F is a generating class. The results allow to extend results by Buan-Krause and Colpi-Gregorio to the general context of Grothendieck categories and to improve some results of (co)tilting theory of modules.