Kensington Palace is in Kensington Gardens, which forms the western extension of Hyde Park. The walk is roughly between 1� and 1� miles. (To walk it, turn right when you leave the Natural History Museum, then right again onto Queens Gate. At the top of Queens Gate you'll come out opposite Kensington Gardens. Enter, and head off to your left).
You could save a bit of walking by taking the Tube, on the Circle Line, for just one stop (clockwise) to High Street Kensington. The just follow the signs, along Kensington Road (eastbound) towards Kensington Palace.
If you'd rather take a bus, turn right out of the NHM and then left onto Queensberry Place. At the end of Queensberry Place cross over to the far side of Harrington Road and catch a number 49 bus (which runs to the stop nearest to Kensington Palace).
Chris