The former Baywatch star said there was no longer any need to keep him “trapped in a small room” now that Sweden has dropped its case against him.
Mr Assange has been holed up in the Ecuadorian Embassy in London for almost five years after seeking asylum as he feared he would be extradited to Sweden to answer allegations of sexual assault which he denied.
He was also concerned that if he was taken to the Scandinavian country then he could be sent to the US to face trial over WikiLeaks’ release of classified American government documents.
In the letter, Anderson said Theresa May was the “worst prime minister in living memory” but praised Labour leader Jeremy Corbyn.
The 49-year-old actress continued: “But Theresa May – who kept him imprisoned in the embassy for five years – refuses to allow him to leave.
“Theresa May, who is on her last legs. Theresa May of the pyhrric victory (sic).
“Theresa May, who won’t shake the hand of the victims of the Grenfell fire. Who doesn’t care about poor people. Who doesn’t care about justice or peace. Who doesn’t care about Julian.
“The worst prime minister in living memory.”
Anderson also invited French President Emmanuel Macron and his wife Brigitte to the opening of her new restaurant in France in July, and asked him to grant Mr Assange asylum.
She wrote that she and Mr Corbyn have a mutual compassion for animals, while saying Mr Assange, 45, should be given compensation.
To Mr Corbyn, she said: “I have watched the recent UK election with great interest. I have cheered the turn in your party’s fortunes! You are clearly a decent and fair man.”
Anderson describes the US government as the “ultimate bully, a superpower, with 1,200 military bases all around the world”.
In the letter posted on pamelaandersonfoundation.org, the ex-Playboy model gushed over how his “bravery and courage” make Mr Assange sexy.
She signed it: “I love you, Pamela.”