Hanyu Pinyin is the official system to transcribe Mandarin Chinese sounds into the Roman alphabet. It was invented in 1950s, and adopted as a standard in mainland China in 1958. Pinyin is used for several purposes, such as teaching Chinese, transcribing names and places into the roman alphabet, and used as an input method for typing Chinese characters.
Pinyin is not the only system devised to transcribe Chinese sounds into roman letters. An older system called Wade-Giles was used in the first half of the 20th century, and it has left its mark on the English language. For instance, 功夫 is romanized as "kungfu" in Wade-Giles, but "gongfu" in Pinyin. Also, 北京 (the capital of China) was in the past romanized as "Peking", but is "Beijing" in Pinyin. It is a common misconception that the city changed names, but the sound never changed, only how we spell the sound with letters.