Go to Settings > Screen Time.
Tap tap App & Website Activity, then tap Turn On App & Website Activity.