Does our device or geolocation services save all history about our locations?

  1. Does our device or geolocation services save all history about our locations? I mean all places where we were during a week , month, year are saved?
  2. where they are stored and how we can delete all this data and make the phone like "new one"?