Obama reportedly said that line in 2020 , during the Democratic primary, with the quote first surfacing in reports around August 2020 and attributed to a conversation about Joe Biden’s campaign.

What was reported

The wording most often repeated is: “Don’t underestimate Joe’s ability to f--- things up,” and it was reported as a private remark Obama made to a fellow Democrat.
A later 2023 writeup also referenced the same reported comment as something Obama said in 2020.

Context

The line circulated as a political rumor for years because it was sharp, memorable, and anonymously sourced.
It was widely framed as Obama expressing skepticism about Biden’s electoral prospects during the 2020 race.

Bottom line

So the short answer is: Obama was reported to have said it in 2020, not publicly on a recorded stage, but in a private conversation that later leaked to the press. TL;DR: The quote is generally traced to August 2020 reporting about a private remark Obama supposedly made during the 2020 Democratic primary.