Yes, they did. I can't speak for other eras - doubtless I could dig up a post or two for the Greeks or Romans if I looked hard enough, blight knows we have enough Greekists and Romanists hanging about - but for the Medieval Period, the people and the law and the clergy most definitely understood that too much alcohol can do bad things. Here's a few previous posts on alcohol in the Middle Ages for your perusal:
While not directly related to your answer, I also know exactly how these threads go, and if anyone so much as mentions that Popular Myth about pre-modern peoples drinking alcohol because the water was unsafe...I address that myth in this post.
And as always, if anyone else would like to address the question, please don't let this post stop you! More answers are always, always welcome.
To add a perspective, to supplement the very good answers linked to so helpfully by u/DanKensington , from my era of knowledge (190-280 CE China) yes, there was an awareness that alcohol could be dangerous if used in excess. While there are stories of figures who, as well as being major officials, were champion drinkers, there were others noted to have not drunk alcohol either on medical grounds (water was the choice for a healthy option though wine could be medicated) or as part of their lifestyle of restraint.
For many, drinking was a fun thing to do with friends, poems were written about wine, drinking parties were held even by Emperors and a good time was meant to be had by all. But there was an awareness there needed to be restraint and that one could be problems if one indulged too much in drinking.
Famed poet Cao Zhi was a major part of the Ye literary circles, a potential heir to the warlord Cao Cao. However, was a noted drinker in his youth and his impulsive behaviour including the drinking did not help his cause as he lost out to his elder brother Cao Pi. On what remains of his fu on wine, he makes the case for the wonders of wine, how it is made, the fun people can have (and the disapproval of those seeking the drunken antics), the way it takes one away from troubles. Right at the end he also has a figure raising objections to the behaviour of the drunks, calling for restraint. Translation from Robert Cutter
Thereupon, Mr. Do-gooder heard this and sighed, saying, “Ai! What you say is way too slapdash!
This drinking is the root of debauchery and profligacy, and is not what a worthy person does. As to being addicted to drink and being as uninhibited as one wants, former rulers prohibited this, and it is what a gentleman condemns.
Qing editor Ding Yan includes variants of the poems of Cao Zhi in his collection and one such was on the warnings of getting sloshed.
How can one wallow in wine to make merry, Deny the teachings of former sages, Repudiate the clear injunction of the “Proclamation on Alcohol,” And conform to the arch villains of the Three Ages
We do get figures of the era whose drinking became noted was on a scale that was considered problematic. Including health problems being linked to excessive drinking or health concerns from those who loved them.
Bian Lan, a nephew of the wife of the warlord Cao Cao and a favourite of successive Wei Emperors as an honest adviser, suffered from diabetes. This was attributed at the time to his excessive drinking and despite medical care (and despite Emperor Cao Rui's attempts to get him to try a miracle cure) diabetes, with emphasis on being caused by drink, was blamed for his death.
Liu Ling was one of the Seven Sages of the Bamboo Grove, a group of scholars, philosophers and musicians who turned against societal convention, including heavy drinking. Liu Ling was famous as a sometimes nudist and was a notorious drinker who composed a "Hymn to the Virtue of Wine". Once when he demanded wine to quench his thirst, his wife attempted to get him to stop drinking as was not healthy but he was dismissive of her concerns and would continue his drinking.
Liu Yan of Shu-Han had travelled across the land with Liu Bei and held high rank under his son Liu Shan. Eloquent and favoured, he was sacked in 232 after a boastful row with general Wei Yan which he blamed on being drunk at the time. He admitted to the chief minister Zhuge Liang he constantly overindulged in wine and promised to change so his ranks (if not his actual command) were restored but he did not keep his promise. His failure to restrain his drinking was blamed for his deteriorating mental state, and his confusion. Two years later he was executed after causing a scandal via accusations against the Emperor and a case of brutal domestic abuse against his wife Lady Hu.
Sources:
The Records of the Three Kingdoms by Chen Shou with annotations by Pei Songzhi (Weilue from Yu Huan for Bian Lan)
Comprehensive Mirror in Aid of Governance by Sima Guang, translation and notes by Achilles Fang
The Incident at the Gate: Cao Zhi, the Succession, and Literary Fame by Robert Cutter
The Poetry of Cao Zhi by Robert Cutter
Empress and Consorts by Robert Cutter and William Cromwell
A New Account of Tales of the World by Liu Yiqing, translated by Richard Mather