WASHINGTON — The dinner in the private upstairs dining room of the White House went so late that Reid Hoffman, the LinkedIn billionaire, finally suggested around midnight that President Obama might like to go to bed.

“Feel free to kick us out,” Mr. Hoffman recalled telling the president.

But Mr. Obama was just getting started. “I’ll kick you out when it’s time,” he replied. He then lingered with his wife, Michelle, and their 13 guests — among them the novelist Toni Morrison, the hedge fund manager Marc Lasry and the Silicon Valley venture capitalist John Doerr — well past 2 a.m.

Mr. Obama “seemed incredibly relaxed,” said another guest, the writer Malcolm Gladwell. He recalled how the group, which also included the actress Eva Longoria and Vinod Khosla, a founder of Sun Microsystems, tossed out ideas about what Mr. Obama should do after he leaves the White House.

“Where we’ll end up, I don’t know yet,” said Marty Nesbitt, the president’s longtime Chicago friend who is leading an extensive planning effort for Mr. Obama’s library and an anticipated global foundation.