Astronaut
The first civilian in space was Valentina Tereshkova aboard Vostok 6 (she also became the first woman in space on that mission).
Tereshkova was only honorarily inducted into the USSR's Air Force, which did not accept female pilots at that time. A month later, Joseph Albert Walker became the first American civilian in space when his X-15 Flight 90 crossed the line, qualifying him by the international definition of spaceflight. Walker had joined the US Army Air Force but was not a member during his flight. 
The first people in space who had never been a member of any country's armed forces were both Konstantin Feoktistov and Boris Yegorov aboard Voskhod 1.
List of spaceflight records
NASA astronaut Peggy Whitson holds the record for the longest single spaceflight by a woman when she surpassed Italian astronaut Samantha Cristoforetti's 199 days, 16 hours during Expedition 52 in 2017. She returned to Earth in September 2017, having spent 289 days, 5 hours and 1 minute in space. In third place is American astronaut Sunita Williams with 195 days on the ISS, where she was a member of Expedition 14/Expedition 15 (2006–2007).