Parseltongue was the language of serpents and serpentine creatures. It was a very rare language because there were very few wizards who were able to speak it. It was usually passed down through a family lineage and nearly every wizard who could speak it after Salazar Slytherin were a descendent. It was connected in the wizarding world to the Dark Arts and speaking it was thought to be a sign of a Dark wizard.
The language was first heard in Harry Potter and the Philosopher's Stone, and not identified until Harry Potter and the Chamber of Secrets. It had an appearance in every one of the Harry Potter books.
Whenever Harry tried to speak Parseltongue without talking to a snake, he couldn't and thought he had to be facing one in order to speak it. However, he later found a way to speak it when he needed to in order to open things.
Slytherin's descendent, Tom Riddle learned he could speak Parseltongue when he was a child. When he started Hogwarts School of Witchcraft and Wizardry, he found out about the lineage and due to being the Heir of Slytherin, he opened the Chamber of Secrets. He opened it and controlled the Serpent of Slytherin through Parseltongue.
In June 1991, Harry first spoke Parseltongue when he was aged ten. He was at the zoo speaking to a snake and when it spoke back, he knew that the snake could understand him. He had no idea he was speaking another language and thought he was speaking English.
In December 1992, he spoke it for the second time during a Duelling Club. The snake was heading towards Justin Finch-Fletchley when Harry told it not to attack in front of everyone, shocking everyone in the school including Severus Snape. The other students even thought that he was telling the snake to hurt Justin, and thought Harry was the Heir of Slytherin and that it was a sign he was a Dark wizard.
Ronald Weasley and Hermione Granger told Harry that he had spoken Parseltongue. Harry was shocked that he was able to speak a language he had never learned, and that he didn't even know he was speaking it in the first place. They told Harry that Salazar Slytherin could speak to snakes, and Hermione pointed out he could be a descendent of Slytherin. Due to the ability to speak and understand Parseltongue, he was the only one at Hogwarts who could hear the voice of the Serpent of Slytherin.
In May 1993, he opened the entrance to the Chamber of Secrets by telling a snake carving on a tap to "open up" in Parseltongue. A young Tom Riddle let the Serpent of Slytherin out through Parseltongue, and controlled it by speaking the language and telling it to attack Harry.