The Pirates of the Caribbean actor, who shared a trailer with Richards when he played his on-screen dad in the third instalment, said that he was too scared to play his guitar on set in front of the Rolling Stones rocker.
Depp told PA: "It took me about 11 years before I could actually touch a guitar in Keith's presence, and that's just to pick it up and move it. There are just some things you don't do."
He also admitted that it felt "strange" to spend time with Richards because he had inspired his character Captain Jack Sparrow in the films.
He said: "The character's main ingredients came up from mixing Keith Richards and Pepe Le Pew. I was a little worried about what Keith was going to think.
"I didn't fear Pepe Le Pew but I did get worried about Keith, because for a good portion of the time I was spending with him, I was sponging as much as I possibly could to use for the character."
Depp revealed that Richards was "very sweet" when he discovered that he was the inspiration for the character, adding that it was "amazing" to "bring him into the fold" of the films when he was cast as Sparrow's father in Pirates of the Caribbean: At World's End.
The star recently said that sharing a trailer with Richards was as close to "being in a rock 'n' roll band" with him as he could ever hope to get.
Watch Johnny Depp in the Pirates of the Caribbean: On Stranger Tides trailer below: