At the end of the 5th century, Pope Gelasius declared February 14th to be St. Valentine's Day, according to History.com. The day did not become associated with love until the 15th century, when the first written valentines began to appear.
The Roman pagan holiday Lupercalia was a fertility festival dedicated to Faunus, the Roman god of agriculture, and it was traditionally held on February 15th. The Catholic Church deemed the holiday illegal and substituted a holiday celebrating Saint Valentine instead. The oldest existing valentine is a letter written in 1415 by the Duke of Orleans to his wife during his imprisonment in the Tower of London.