When Disney bought out Lucasfilm in 2012, one of the first things they did was promise nothing would change. This was a lie, of course. By 2014, it was clear to them the new films would contradict the legions of books, comics, and radio plays that form what was called "The Extended Universe." They reclassified them as "Legends." This included all of Han Solo's history and adventures prior to A New Hope. Solo: A Star Wars Story rectifies this by answering all the questions about him anew, including how Han Solo got his name, as well as some other details fans have always wanted the answers to. Warning: Spoilers for Solo: A Star Wars Story follow.
In the Legends version of Han's story, Solo is actually his family's name. Han did grow up an orphan on the streets of Corellia, working for a bounty hunter named Garris Shrike, who isn't all that off from the Lady Proxima character in the film. But he also had a family figure. Her name was Dewlanna, and she was Shrike's Wookiee cook.
Dewlanna was the one who taught Han Shyriiwook, nursed him when he was sick, and helped him grow up. She was also the one who helped him discover his family, The House of Solo, who were actually Corellian royalty back during the Golden Age of The Republic. That's right: Han Solo was secretly descended from a prince.
Not that Han got along with his family when he met them. Like the Gaunts in Harry Potter, the Solo's collapse in fortune has not gone over well. His aunt, Tiion Solo, was a madwoman, and housebound. His cousin Thrackan Sal-Solo, who looked after her, was an underhanded schemer who'd sold Han to Shrike in the first place. That's why Han never talks about his family and doesn't bother telling people his history.
Now Disney has reclassified this history as Legends, they are free to rewrite Han's story at will. The House of Solo? Out the window. Now he's Qi'ra beau, and his family is no-show.
In fact, Han doesn't even have a last name at all. He and Qi'ra have no family, so why would they have family names? It's not like either of them would want to take Proxima as a surname, even if they were good with being associated with her, instead of trying to escape. There's no kindly Wookiee in Han's life either, so exactly how or why he learned Shyriiwook goes unexplained, though he speaks it badly enough one could assume he'd just picked it up off the street.
So how does Han wind up with the last name Solo? When he becomes separated from Qi'ra at the beginning of the film, he doesn't know what to do with himself. He wants to become a pilot, but he's rudderless and is looking for a sense of direction. Like many young men who are adrift, he decides to enlist in the Imperial Forces, thinking they'll teach him to fly.
This is actually in line with Han's story in Legends. He too enlists, and becomes an Imperial pilot, one of the best in the galaxy, just as Han boasts to the recruiter he will on screen. Of course, in the film, he gets kicked out of the flight academy "for having a mind of his own" and winds up a groundling grunt.
But before any of that happens, the recruiter needs a last name for Han's files. Han is completely at a loss. he doesn't have people. He has no last name. He's lost Qi'ra, and he's alone in the world.
So the recruiter gives him one. Han alone? Han Solo. It's a cheesy answer, but it works.