Hope Hicks, the White House communications director and one of President Trump’s longest-serving advisers, said Wednesday that she was resigning.