Memory, woven into the very fabric of consciousness, serves as a time-traveling vessel in the mind, using detailed recollections not just for nostalgic reflection but as an abstract map for charting unknown futures. Here, we employed fMRI to investigate how the hippocampus (HPC) encodes detailed experiences into abstract knowledge (i.e., formation) and uses this knowledge for decision making (i.e., utilization) when human participants learned and then utilized spatial-temporal relations in a relational memory task. We found a functional gradient along the anterior-posterior axis of the HPC, characterized by representational similarity and functional connectivity with the autobiographical network. Here, the posterior HPC was more actively engaged in memory formation, whereas the anterior HPC was predominantly involved in memory utilization. Our computational modeling of relational memory further established a causal link between this functional gradient and the HPC's well-documented anatomical gradient, as optimal task performance arose from a combination of a fine-grained representation of past experiences by the posterior HPC and a coarser representation of abstract knowledge for future planning by the anterior HPC. This scale-dependent coding scheme led to the emergence of grid-like, heading direction-like, and place-like units in our neural network model, analogous to those discovered in biological brains. Taken together, our study revealed the HPC's functional gradient in representing relational memory, and further connected it to the anatomical gradient of place cells, supporting a unified framework where both spatial and episodic memory rely on relational representations that integrate spatial localization with temporal continuity.