Windsor Castle is fabulous. It dates back to Norman times and was constructed on the orders of William the Conqueror. I visited a few times when I lived in London and took the train from Central London to Slough and a bus from there to Windsor. I explored different transport options but found that the easiest. It takes virtually a full day to see round it but there is so much to see. It is also the principal home of HM The Queen to this day, as my first tour guide informed me - it is not Buckingham Palace, as many believe!
Hampton Court Palace was perhaps best known as home to Henry VIII. It is even closer to Central London but unfortunately my planned visit had to be cancelled at the last minute and I never got to rearrange it.