There are multiple versions of how The Joker got his scars in both the comics and the movies. Originally, in the comics, he is said to have fallen into a vat of chemicals while fleeing from Batman. When he emerges later in the sewers he is horribly disfigured.
The Joker does not have one origin story and often tells conflicting stories about how he got his scars. In the comics, it is later said that Batman causes the disfigurement with a batarang. In the Dark Knight, he gives at least two different accounts, first stating that his father cut him. He later states that he caused the scars himself so as to show his disfigured wife that the scars were not important.