As of May 19, 2024, the oldest person to fly in space is sculptor and historian Ed Dwight, aged 90 years 8 months at the time of his flight, narrowly edging out Canadian actor William Shatner (The Devil's Rain, T.J. Hooker, Boston Legal), who was 90 years 6 months old on his October 13, 2021 flight. Both were brief suborbital flights above the Kármán line on Blue Origin's NS25 and NS18 respectively.
Astronaut John Glenn holds the record for oldest person in orbit by a fair margin; he flew on STS-95 at the age of 77 -- officially as a "payload specialist", but in practice as a passenger.
A number of other astronauts have been to space in their late 50s and early 60s. Of these, Story Musgrave, the second-oldest, has flown over 1200 hours in space on 6 different shuttle missions from age 47 to 61. The linked article actually isn't complete; it's missing (at least) Pavel Vinogradov, the oldest spacewalker and I believe the oldest cosmonaut, having commanded ISS mission 36 at the age of 60.
The youngest person in to fly in space is Oliver Daemen, an 18-year old Dutch student. This was also a short suborbital flight above the Kármán line, Blue Origin's NS16 in July 2021.
The youngest person in orbit was 25-year-old Gherman Titov on Vostok 2 -- USSR's second cosmonaut and the 4th person to fly into space.
Sally Ride was the youngest American NASA astronaut, flying STS-7 at the age of 32.
Hayley Arceneaux was the youngest American to orbit the Earth, on SpaceX's private Inspiration4 flight in 2021, at age 29.