When John and Yoko began living together in 1968, divorce proceedings began between John and his wife Cynthia. Paul McCartney, who was very close to John and Cynthia’s son, Julian, was concerned over John’s marriage breaking up, and in support of Cynthia and Julian, wrote this song. Originally titled “Hey Julian,” it later developed to “Hey Jules,” then finally “Hey Jude,” because it was thought Jude was a stronger sounding name.
The song is merely a message to Julian, then five years old, of encouragement while his parents went through their separation and divorce. Although Julian at this young age knew what the song was about, he did not learn the facts first hand from Paul until 1987 when the two happened to run into each other at a New York hotel. This had been the first time in years that the two had an opportunity to sit down and talk with each other. Paul and Julian had a wonderful friendship and closeness as Julian grew up, and Julian recalled that there went lots of pictures of he and Paul, more so than there were on him with his father, John.
“Hey Jude” turned out to be the most successful song The Beatles ever released. It was recorded in two days at Trident Studios, London, on July 31 and August 1, 1968, using a 36-piece orchestra, and by the end of that year had sold more than five million copies.
source: I Am the Beatles