The 83-year old explained: "A persistent health issue has turned into something quite a lot bigger. I've been diagnosed with pancreatic cancer."
Robertson added that she is due to start chemotherapy soon.
Ruth Langsford, one of the presenters of the mid-morning show, said the team were in a "state of shock".
"After almost 30 years of providing comfort to millions of viewers, agony aunt Denise Robertson is in need of a lot of love herself today," Langsford said.
Denise Robertson has been with the programme since it began in 1988.
She said the diagnosis had "come as a surprise to me and my family" but added: "We know that many others have suffered and dealt with this condition and I don't plan to give up without a fight."
She also thanked viewers of This Morning who had sent in messages of concern in recent weeks.
Tweeting his support for Robertson, fellow ITV presenter Leigh Francis said: "Sending all my love a support to Denise. Stay positive and get well soon."
This Morning presenter Philip Schofield said: "Sending all my love to a unique and wonderful lady."
Sunderland University, who have often invited local-born Robertson there as a guest speaker, tweeted: "Thoughts are with honorary graduate Denise Robertson today following the news she has been diagnosed with cancer."
In addition to solving personal problems on the ITV programme, Robertson also has her own advice website and has written columns for Candis magazine.
Her television career started in 1985 when she joined the BBC's Breakfast Time programme, as it was called then.
Since becoming well known as an agony aunt, she has also written several novels and appeared as a guest on programmes such as The Weakest Link, The Paul O'Grady Show, Celebrity Mastermind and Loose Women.
She was appointed an MBE in 2006 for services to broadcasting and to charity.
She lost her first husband Alex Robertson to lung cancer in 1972, but kept his surname when she remarried.
In 2006 her stepson, John, also died of cancer, at the age of 44.
Denise Robertson, resident agony aunt of ITV's This Morning, has been diagnosed with cancer.