There is no agreed story or history of how Valentines Day came about, but I came across this version a few years ago.
Valentine's Day started in ancient Rome. February 14th was a holiday to honour Juno the Queen of the Roman Gods and Goddesses. The Romans knew her as the Goddess of women and marriage. The following day, February 15th, began the Feast of Lupercalia. This was a longstanding cutom which involved a feast in honour of the heathen god.
Under the Roman Empire the lives of young boys and girls were strictly separate. However, one of the customs of the young people was name drawing. On the eve of the festival of Lupercalia the names of Roman girls were written on slips of paper and placed into jars. Each young man would draw a girl's name from the jar and would then be partners for the duration of the festival with the girl whom he chose. Sometimes the pairing of the children lasted the entire year, and often, they would fall in love and would later marry.
The pastors of the early Christian Church in Rome endeavoured to do away with the pagan element in these feasts by substituting the names of saints for those of maidens. And as the Lupercalia began about the middle of February, the pastors appear to have chosen Saint Valentine's Day for the celebration of this new feast.
Under the rule of Emperor Claudius II Rome was involved in many bloody and unpopular wars. 'Claudius the Cruel' was finding it very hard to get soldiers to join his military. He became convinced that the reason was that roman men did not want to leave their wives and families. As a result, Claudius cancelled all marriages and engagements in Rome.
Saint Valentine was a priest at Rome at this time. He and Saint Marius aided the Christian martyrs and married couples in secret. When the authorities discovered this he was apprehended and dragged before the Prefect of Rome, who condemned him to be beaten to death with clubs and to have his head cut off!
In prison, the jailers daughter was often present and tended to some of the prisoners. She and Valentine became close, and Valentine fell in love.
He was executed on the 14th day of February, about the year 270. He left a note in his cell for his new love and signed it "From your Valentine."
The custom of young men choosing maidens for valentines, or saints as patrons for the coming year, arose from the drawing ceremony. Eventually instead of drawing names, men selected a maiden and sent a message to them to indicate attraction. The line "from your Valentine" or "be my Valentine" started getting used as per Valentines original note.