If you use self-hosted Matomo, heatmaps and session recordings are kept indefinitely.

If you use Matomo Cloud, heatmaps and session recordings are kept for 3 months.

Previous FAQ: Is the recorded heatmap & session recording data accurate?