Yuri Gagarin's spaceflight preceded Alan Shepard's spaceflight by about three weeks.
Notes on verification
Well-documented dates from NASA, FAI, and multiple independent secondary sources consistently confirm a 23-day gap between the two flights.
Sources
- How Yuri Gagarin Was Picked to Be First in Space (smithsonianmag.com)
- https://www.nasa.gov/image-article/trajectory-of-alan-shepards-historic-flight/ (nasa.gov)
- https://www.fai.org/news/60-years-alan-shepard-became-first-american-space (fai.org)
- https://www.space.com/11578-nasa-alan-shepard-space-race-human-spaceflight.html (space.com)