Sandpaper has a long history. It has actually existed since 13th century China. How sandpaper is made has changed significantly over time but we don’t have an exact estimate of when it was invented since it has existed for so long.
Early sandpaper was made from crushed seeds, shells, sand and other material stuck to parchment. Nowadays there is a wide variety of various types of sandpapers used for different surfaces. You can read more about sandpaper here.