He said Mr Trump's attempt to discredit a poll before it has even taken place was "unprecedented" for a US presidential candidate.
Also "unprecedented", said Mr Obama, was the Republican candidate's "flattery" of Russia's president.
Mr Trump is facing sinking poll numbers and accusations of sexual assault.
The businessman-turned-politician has claimed the 8 November election will be "absolutely rigged" for Democratic candidate Hillary Clinton.
But in a White House Rose Garden news conference on Tuesday alongside visiting Italian Prime Minister Matteo Renzi, Mr Obama said his assertions were "based on no facts".
"I'd advise Mr Trump to stop whining and try to make his case to get votes," Mr Obama said.
"By the way," he added, "[it] doesn't really show the kind of leadership and toughness that you want out of a president, if you start whining before the game's even over.
"If whenever things are going badly for you and you lose you start blaming somebody else, then you don't have what it takes to be in this job."
Mr Obama also addressed the Republican candidate's admiring remarks about Vladimir Putin.
"Mr Trump's continued flattery of Mr Putin and the degree to which he appears to model much of his policies and approach to politics on Mr Putin is unprecedented," he said.
His broadside comes a day after Mr Trump said he would consider visiting Russia before taking office, if elected.
He told a talk-radio host: "If I win on November 8, I could see myself meeting with Putin and meeting with Russia prior to the start of the administration."
Mr Trump and Mrs Clinton face off in the third and final presidential debate at the University of Nevada, Las Vegas, on Wednesday.
The Republican candidate has seen his poll numbers slide since their first battle of wits, followed by the emergence of a 2005 sex boast tape that he was forced to address in the second debate.
Mr Trump denied any impropriety, but a number of women have come forward with sexual assault allegations against him.
Mrs Clinton will head into Wednesday's debate with a seven-point lead over her Republican rival, according to a Monmouth University poll.
She leads Mr Trump 47% to 40%, while 7% of likely voters say they will support the Libertarian Party candidate, Gary Johnson.