1835, "character representing a sound, a character used in phonography," from phono- "sound" + -graph in the sense of "something written." This older sense was rare and is obsolete.
The meaning "an instrument that produces sounds from recordings" (talking phonograph, invented by Thomas A. Edison) is attested from 1877, with -graph more in the sense of "instrument for recording." "In Britain the word is retained only for early cylinder machines, but in N. Amer. it has become synonymous with record player, record deck, etc., corresponding to British gramophone" [OED].
The recording made from it at first was called a phonogram (1879). An earlier instrument for registering the vibrations of a sounding body was the phonautograph (1859, from French phonautographe, 1855).