We study when the heart of a t-structure in a triangulated category D with coproducts is AB5 or a Grothendieck category. If D satisfies Brown representability, a t-structure has an AB5 heart with an injective cogenerator and coproduct-preserving associated homological functor if, and only if, the coaisle has a pure-injective t-cogenerating object. If D is standard well generated, such a heart is automatically a Grothendieck category. For compactly generated t-structures (in any ambient triangulated category with coproducts), we prove that the heart is a locally finitely presented Grothendieck category.We use functor categories and the proofs rely on two main ingredients. Firstly, we express the heart of any t-structure in any triangulated category as a Serre quotient of the category of finitely presented additive functors for suitable choices of subcategories of the aisle or the co-aisle that we, respectively, call t-generating or t-cogenerating subcategories. Secondly, we study coproductpreserving homological functors from D to complete AB5 abelian categories with injective cogenerators and classify them, up to a so-called computational equivalence, in terms of pure-injective objects in D. This allows us to show that any standard well-generated triangulated category D possesses a universal such coproduct-preserving homological functor and to develop a purity theory in such triangulated categories. 2.5. t-structures in triangulated categories 13 2.6. Purity and Milnor colimits in triangulated categories 13 3. t-structures and localization of categories 14 4. Homological functors from t-generating classes 18 5. Pure-injective objects and exact direct limits 23 6. Representability for coproduct-preserving homological functors 25 7. Universal coproduct-preserving homological functors 31 8. t-structures with Grothendieck hearts 34 8.1. The AB5 condition for hearts of t-structures via injective cogenerators 34