Wesley first published this text in his 1763 collection, Hymns for Children, in which it was stated that the hymn was to be sung "At the opening of a school in Kingswood."
It was included in the 1847 hymnal, dropped from the 1878 Methodist Episcopal hymnal, but three stanzas were included in the 1889 Methodist Episcopal-South hymnal. It was again deleted from the 1905 and 1935 hymnals, restored in 1964, then removed once again from the 1989 hymnal. It seems our hymnal committees just can't make up their minds about this hymn. These Methodist hymnals have variously included three, four, and all six stanzas.
Although its first publication was in a collection for use by children, the hymn has been sung by worshiping congregations on a variety of occasions: Children's Day; Sunday School Promotion Sunday; Christian Education Sunday; services of baptism, confirmation, and dedication; and others. Notable and often quoted are the lines,
Unite the pair so long disjoined,
Knowledge and vital piety.
Text and tune are in the public domain.