It happens more than you think. You hit the wrong key when booking a ticket online, the reservations agent mistypes the correct spelling of your name (or the correct gender) on your ticket information, or your married name on your ticket doesn’t match the name on your government issued ID.
Here’s what you need to do.
If you notice the mistake within 24 hours of booking, then cancel the ticket for a refund and immediately rebook.
If it’s after 24 hours, you need to call the airline directly.
Most airlines will allow you to make small changes and correct typos but remember to make them for all portions of the trip, especially if you’re flying on different airlines.
One more thing is you’re only allowed to make just one name or spelling correction.
A full name change is a definite no.