Knowledge Graphs (KGs) and heterogeneous graphs (HGs) offer a principled way to represent multi-entity, multi-relational systems, while also revealing a persistent tension between expressive modeling, scalable learning, and faithful reasoning.Two trends are rapidly reshaping the field: graph foundation models (GFMs), which seek transfer across graphs, tasks, and domains via large-scale pretraining, and the growing integration of large language models (LLMs) with graph-structured knowledge to improve grounding, interaction, and reasoning.Temporal settings add further challenges, as evolving facts and interactions demand time-consistent modeling and evaluation.This tutorial provides a structured survey of these directions: we introduce a unified background and notation for typed heterogeneous graphs, (temporal) KGs, and event-based temporal heterogeneous graphs; we then formalize the main task families (KG completion, query answering, node/graph prediction, and temporal variants), emphasizing evaluation protocols and leakage pitfalls.Finally, we review recent advances in GFMs and LLM-graph integration, and summarize the state of the art in learning over temporal heterogeneous graphs and temporal KGs.