Chronologically speaking, Peggy Carter’s story ended in Captain America: Civil War, when she passed away (with possibly two Steve Rogers’ attending her funeral). Narratively though, I agree with Hayley Atwell’s assessment that Steve and Peggy ending up back together in Avengers: Endgame is fitting. After approximately more than a decade of fighting the forces of evil, and following Natasha Romanoff and Iron Man’s deaths, Steve finally decided to retire from superhero-ing and return to the woman he still loved after all this time.
Article source: https://www.cinemablend.com/news/2478245/hayley-atwell-thinks-avengers-endgame-is-a-fitting-end-to-peggy-carters-story