Out of Universe Edit
The sound was made by recording house keys scraping against piano wire & the recording was then processed by slowing it down and reversing it to produce the finished sound effect.
In universe Edit
River said (in "The Time of Angels") that the TARDIS makes the noise because the Doctor always leaves the parking brake on. She is likely to have been making this up to tease the Doctor.
In the classic series, other TARDISes operated by other Time Lords made the same sound, as did several other Time Lord transportation devices.
In the 4th Doctor story "Underworld", the sound was identified by the computer of a Minyan spaceship as being made by "relative dimensional stabilisers ... As used in the timeships of the gods" (the Minyans had had considerable contact with the Time Lords & regarded them as gods).
When the Time Lords revoked the Doctor's exile (at the end of "The Three Doctors"), the new dematerialisation circuit that they sent him appeared with the sound.
In "The Eleventh Hour", when the TARDIS had finished rebuilding herself & sent the 11th Doctor a new key, it materialised in his pocket with the sound.