Nikki R. Haley joked about President Trump’s braggadocio in his United Nations speech last month. Once, she said, he asked if she belonged to the same Native American tribe as Senator Elizabeth Warren. And as a member of Mr. Trump’s cabinet, she added, “It is a thrill to be out to dinner without being harassed.”

For about 17 minutes Thursday night in the New York Hilton ballroom, Ms. Haley, Mr. Trump’s soon-to-be-leaving ambassador to the United Nations, tried her hand at one-liners before a crowd of 700 guests at the annual Al Smith charity dinner, a high-powered event of the political and Roman Catholic elite hosted by Cardinal Timothy M. Dolan.

It was a sort of let-loose opportunity for Ms. Haley, 46, a Republican star who is widely thought to have presidential ambitions — although she has dismissed the idea of running against Mr. Trump, with whom she appears to have a good relationship.

Still, it remains unclear precisely why Ms. Haley is leaving her United Nations post after less than two years, and her monologue did nothing to provide answers.