On 19 November 1947, the day before his wedding to Princess Elizabeth, his father-in-law King George VI bestowed by Letters Patent the style His Royal Highness on Philip, and on the morning of the wedding, 20 November 1947, further Letters Patent of that day created him Duke of Edinburgh, Earl of Merioneth, and Baron Greenwich of Greenwich in the County of London. As was usual, the titles were in remainder to the 1st Duke’s heirs male of the body lawfully begotten.1
With the death of the Duke of Edinburgh, his titles have passed to his eldest son and heir Prince Charles, The Prince of Wales. Prince Charles has gained the titles Duke of Edinburgh with its subsidiary titles of Earl of Merioneth and Baron Greenwich, of Greenwich in the County of London.
The College of Arms confirmed, “These peerages are hereditary and on the death of His Royal Highness have passed to his eldest son, HRH The Prince of Wales. In the event of the Prince of Wales or any subsequent holder of these titles succeeding to the Crown, these titles and all others held will merge with the Crown.”2
However, you may remember that it was announced upon the marriage of his younger son Prince Edward to Sophie Rhys-Jones that “The Queen, The Duke of Edinburgh and The Prince of Wales have also agreed that The Prince Edward should be given the Dukedom of Edinburgh in due course, when the present title now held by Prince Philip eventually reverts to the Crown.”3 Once Her Majesty The Queen passes and Prince Charles succeeds her as King, his titles, including the Duke of Edinburgh title, will merge with the crown. He will then be free to create the title again for his brother, who then becomes The Duke of Edinburgh at last.
The Prince of Wales’ wife automatically shares all his titles, so the Duchess of Cornwall is now also Duchess of Edinburgh.
Update: Upon the accession of King Charles III, the Duke of Edinburgh title merged with the Crown. On 10 March 2023, King Charles recreated the title for his brother, Prince Edward, for life.