Mr Gil, 66, has been in government since 2003, but said for some time that he was finding it difficult to pursue two demanding roles.
He said public speaking was affecting his singing ability.
As culture minister, he championed sometimes neglected forms of cultural expression such as indigenous painting.
However it was always clear that he hankered to return to his artistic career, and some critics questioned the level of commitment to his political role, says the BBC's Gary Duffy in Sao Paulo.
But the outgoing minister said he not been worried about the criticism he faced over the overlap between his artistic and political roles.
Priority
Mr Gil said that the culture ministry's executive secretary, Juca Ferreira, would take over from him.
He added he had tried to resign twice since late 2007, but President Luiz Inacio Lula da Silva had refused to accept his resignation.
This time, the president agreed with Mr Gil's request, saying the singer and composer was "going back to being a great artist, going back to giving priority to what is most important" to him.
His music-making had been limited by the demands of government, and he had to seek the president's permission to tour abroad.
Period in exile
Alongside his long musical career, politics has played a prominent part in Gilberto Gil's life, our correspondent says.
He first made his mark in the 1960's along with the singer Caetano Veloso.
Their Tropicalismo movement with its mix of Western rock and Brazilian musical styles, and an emphasis on personal freedom, was considered subversive enough for both men to be briefly arrested in 1969 under Brazil's military dictatorship.
They were freed on condition they leave the country, and Gilberto Gil went to live in London.
He returned to Brazil in 1972, and after concentrating on his music he later began his political career.
When selected by President Lula to be minister of culture, Mr Gil was only the second black person to serve in the country's cabinet.
His resignation certainly removes one of the more intriguing figures from the Brazilian political stage, our correspondent notes.
Read more...