The 2005 movie became a breakout performance for both the actors but Ledger died of an accidental overdose of prescription drugs in 2008.
"Personally, it affected me in ways I can't necessarily put in words or even would want to talk about publicly," Gyllenhaal, 35, told People.
"In terms of professionally, I think I was at an age where mortality was not always clear to me. I think you live in this bubble, too, of making films ... There are real friends, and there is a real community," he said of the experience.
Gyllenhaal says they had no idea that the film will become so big.
"We were super young. We had no idea what the movie was going to become.