Disappears between the 1880 and the 1900 census (there is no 1890 census), when his wife is a widow.
BB sent for and received a death record for a William Gray, died 29th Jan 1893 but he turned out to be a Catholic bachelor, born in the US, father called Richard.
The same source who gives William as married to a Jane Carson give his death as 1882.
From A.com via BB:
1890 City Directory - NYC - [Census substitute]
Gray Margaret, wid. William, h 204 Eighth av.
This shows William was dead by 1890.
BB received death cert from NY Deaths for a William Gray who died on 24 Feb 1881 @ 4:05pm, aged 48 years, which fits roughly with his DoB of 1837. It gives his birthplace and that of his father as Ireland but it says he was in the States for 33 years and in fact he was only there for 21 years in 1881. Also, he died in Mulverry street rather than West 13th Street, which is where he was living in 1880. So, this is probably not him. He died of Phthisis, Brights Disease, Mitral Regurgitation and Asthenia.
BB: I ordered 1881, 1883, 1884, 1885, 1886 to be searched for William Gray on 9/21/08 #2203119201. Received letter: NOT FOUND - included a death cert, however, for a William Gray, age 48, widower who died in Charity Hospital in 1881. Even if him there is no indication of parents and he was 15 years old when he emigrated. (33 yre in nyc). I ordered 1887, 1888, 1889 and 1890 to be searched for William Gray (died in Manhattan) on 1/28.09 #3318843874. Mail just arrived- and they did NOT find William Gray 1887-1890. I am now thinking that if he did die in 1882 as it said on familysearch.org then it was not in Manhattan but possibly another borough of NYC.