Prince Philip received the title of Duke of Edinburgh upon his marriage to Queen Elizabeth in 1947 and this title will pass on to his youngest son, Prince Edward, the current Earl of Wessex.
This arrangement was declared in 1999 when Edward married Sophie Rhys Jones, who became known as the Countess of Wessex. While Queen Elizabeth created the Wessex titles and the earldom for the couple, it was always understood that Edward would become the Duke of Edinburgh upon Philip's death.
In the history of the royal family, the creation of the Duke of Edinburgh title happened three times. It was originally created in 1726 when King George I wanted to give his grandson, Prince Frederick, a title. Frederick's son, Prince George, inherited this title but he gave it back to the Crown when he became King George III.
In 1866, Queen Victoria recreated Duke of Edinburgh for a second time to give to her son, Prince Alfred. The title reverted back to the Crown when Alfred died in 1900 and it was re-created for the third time by King George VI for Prince Philip.
But Edward wasn't originally meant to have his father's title. According to Tatler, the queen's father, King George VI, issued a Letters Patent declaring the first-born son of Elizabeth and Philip as the next Duke of Edinburgh.
However, the royal couple's first-born, Prince Charles, is also the heir to the throne and will be king when Queen Elizabeth dies. Once he is king, all of his titles will go back to the Crown to be granted to someone else in the royal family. Essentially, this means that Edward will be given his father's title once his eldest brother becomes the monarch, as per the arrangement from 1999.
When Edward becomes the Duke of Edinburgh, his wife will be automatically known as the Duchess of Edinburgh. Consequently, when Edward dies, his son, James, Viscount Severn, would inherit his title.
Incidentally, Edward had a prepared interview with his sister, Princess Anne, discussing the life of his father. ITV pre-recorded this interview while Philip was at the hospital between February and March. The Earl of Wessex said that his father had been a fantastic support for his mother. He also said that he's proud of the achievements Philip started for the Duke of Edinburgh Awards, which has given recognition to recipients in 140 countries.
When Prince Philip retired from public duties in 2017, Edward stepped up and managed the Duke of Edinburgh Awards to honor and recognize young people who have made a difference in the world. Sources said that this became a huge part of Edward's work in the royal family.