Planetary systems across space and time