Mr Castro, 89, told a party congress that he is handing over the leadership to a younger generation "full of passion and anti-imperialist spirit".
His successor will be voted in at the end of the four-day congress.
The move, which was expected, ends the era of formal leadership by him and his brother Fidel Castro, which began with the 1959 revolution.
"I believe fervently in the strength and exemplary nature and comprehension of my compatriots," he told party delegates in Havana on Friday.
. In pictures: Raúl Castro's career over six decades
. Miguel Díaz-Canel: The expected successor
Although Mr Castro has not endorsed a successor, it is widely believed the party leadership will pass to Miguel Díaz-Canel, who took over as the island's president in 2018.
Not unexpected, but no less historic
By Will Grant, Cuba Correspondent
While the entire island knew this moment was coming, it was no less historic or symbolic when it arrived: Cuba will be officially governed by someone other than a Castro for the first time since 1959.
The reality is that, at least in the short term, little will change.
The man who took over from Raúl Castro as president, Miguel Díaz-Canel, may well succeed him now as the party's first secretary too. It seems likely he will be forced to take further steps to liberalise Cuba's centrally controlled economy. The island is currently in the grip of its worst economic crisis since the period immediately following the end of the Cold War. As a result, private farmers were recently permitted to sell beef and dairy products - goods previously under the sole control of the state.
Any hope of improving ties with the US however may have to wait as the Biden administration has shown little inclination to unpick the Trump administration's harsher sanctions on Cuba at this stage.
One thing is for sure, Raúl Castro's words of keeping "one foot in the stirrup" means he will remain a powerbroker behind the scenes. And by reiterating the island's eternal commitment to socialism it means that political change remains as unlikely under his successor as it was under his late brother, Fidel.
End of an era
His retirement means that for the first time in six decades Cuba will not have a Castro formally guiding its politics.
Raúl has been the party's secretary-general since succeeding his older brother, Fidel, in 2011.
Fidel Castro led the revolution that toppled the Cuban government in 1959, when Raúl served as one of his commanders.
Fidel Castro was the country's leader until falling ill in 2006 and in 2008 handed over the presidency to his brother. Fidel Castro died in 2016.
Cuba under Raúl
As leader, Raúl Castro maintained the communists' one-party grip on power.
He oversaw an improvement in relations with United States between 2014 and 2016, including historic talks with President Barack Obama in 2016.
But tensions worsened under Donald Trump, who reinforced sanctions.
Current US President Joe Biden has vowed to relax some of Trump's sanctions, although the White House said on Friday a shift in Cuban policy was not one of his top priorities.
At the congress on Friday, Raúl Castro said his country was willing to "develop respectful dialogue" with the United States but it would not accept having to make "concessions" regarding its "foreign policy and ideals".
What next?
The change at the top of Cuba's governing party comes as the island's leadership is tackling its most serious economic crisis in decades.
The Covid-19 pandemic, financial reforms and restrictions imposed by the Trump administration have hit the economy, which shrank by 11% last year.
A long-awaited currency reform launched on 1 January has sought to make the economy and state companies more efficient. But it has also badly squeezed the budgets of ordinary Cubans.
Many have been calling for much more economic freedom in the country.
Another challenge will be maintaining ideological unity and support in the face of citizens' increased access to the internet and social media. Dissidents have been using social media to stage anti-government protests and gather live audiences online.
In response, the party has said one of the functions of its congress would be "confronting political and ideological subversion, which has made internet and social media its principal field of operations".
But despite the change in leadership, few expect it will prompt a dramatic change in policy direction.
A new constitution in 2019 confirmed state dominance of the economy and the "irrevocability of socialism".
In a tweet on Friday, 60-year-old President Díaz-Canel said the congress would be where "ideas are entrenched, history recognized and the future discussed." But he added that there would be "continuity".
Mr Castro told the congress he was retiring as "a simple revolutionary fighter".
"And as long as I live I will be ready with my foot in the stirrups to defend the fatherland, the revolution and socialism."