I'm going to talk about late medieval London. Firstly, because there are lots of records to work with, and secondly because those records are in English.
From the coroner roles of medieval London, Roll B item 14, the death of Reginald de Freestone, 2 February 1321 (or 1322):
"The jurors say that on the preceding Tuesday at midnight the said Reginald de Freestone, John Bocche, Walter le Skynnere and eleven others whose names are unknown were passing the door of the shop tenanted by William de Grymsby, son of Robert Osekyn, in the parish of St. Benedict Fynk in the Ward of Bradstrete, singing and shouting as they often did at night, when the said William de Grymsby, who was in the shop, besought the said Reginald and his companions to allow him and his neighbours to sleep and rest in peace. Whereupon, the said Reginald de Freestone, John Becche, Walter le Skynnere and the rest of their companions unknown, invited the said William de Grymsby to come out of his shop if he dared.
William of Grimsby did dare. He got a staff and beat the shit out of them, killing Reginald. Evidently, there were bands of drunken mates stumbling about the city at ungodly hours. There were also rough sleepers (both homeless and too drunk to find home) that crop up in the same record when they slept in a particularly unclean place and got fatally sick, or if they died from the cold in winter. There were also prostitutes and drug dealers kicking about looking for clients. Unfortunately, we only get glimpses of this nightlife when it drew the attention of the city's law enforcement, which biases deadly incidents because the coroner's records are well preserved. The volume of paperwork produced when a Londoner got murdered means a good amount of it survives. We can probably assume safely that there were plenty of drunken groups going home after midnight, and that the ones that resulted in someone getting whacked represent a tiny minority of such occasions. And London was far from alone in this respect.
However, the city tried to stop these things from happening as best they could. In the thirteenth century there was growing concern in London that people at night were carrying arms for protection or for their trade, and that this was driving violent crime. There was also the issue of the taverns, which became meeting places for groups of troublemakers. The problem was so concerning that the king intervened, issuing regulation in 1285 that stated:
...whereas such offenders as aforesaid going about by night, do commonly resort and have their meetings and hold their evil talk in taverns more than elsewhere, and there do seek for shelter, lying in wait, and watching their time to do mischief; it is enjoined that none do keep a tavern open for wine or ale, after the tolling of the aforesaid curfew, but they shall keep their tavern shut after that hour and none therein drinking or resorting.
I should point out that these concerns were largely unmerited. From the surviving records, only about 6% of homicides involved taverns or alcohol, even tangentially.
So in theory, the nightlife would cease when curfew came around. People were supposed to go home, and if they had to go out then they had to be carrying a light so they were clearly visible. The timing and terms of curfew varied depending on time and place, but they were the common tactic in the medieval urban world for keeping crime at acceptable levels. Once closing time came around, everyone would hopefully stumble home. The problem with this idea is that the legal definition of a tavern was a bit vague. The earliest taverns were private citizens home brewing and hosting regular drinking nights with their friends who realised they could make decent money charging for it and going full time. However, even once taverns and inns became a ubiquitous part of urban life, those home brewers never went away. Many of the night time disturbances that appear in records come from what happened at the point the taverns were supposed to close. What actually happened was that the taverns closed (often a bit late, as tavern owners sometimes judged that the money from trading for an extra half hour outweighed the fine they might get if caught), and the patrons would then go to private houses and continue drinking long into the night. And because it was in a private rather than public house, the curfew was not technically being broken. Of course, some private houses took this to the level of basically being illegal taverns operating under the guise of a private home brewer who happened to have a lot of friends. There was a drinking nightlife, but revellers had to be a bit clever about how they went about it which, considering the quantity of alcohol imbibed, could be a challenge. By the late-fourteenth century, the city government of London decided to try banning drinking parties entirely because public drunkenness was causing too many problems, but we can safely assume this was not a successful policy because English drinking culture does not seem to have been diminished.
Similar rules applied to the sex industry. Although prostitution was almost universally frowned upon, it was also widely thought on continental Europe that criminalising the sex industry was not worthwhile. Many cities in medieval Europe had official, city run brothels, or in rare cases what we would today call a red light district where privately owned brothels were entirely legal. What was and was not permitted varied - many cities required brothels to close on holy days, or tried to mandate that only single men could visit, and there were no widespread standards as to how prostitutes could be treated by both clients and the brothel owner. The attitude in England was different. With the exception of the town of Sandwich, the sex industry was explicitly criminalised across every town for which we have records, so if someone was hoping enjoy their night with card games and prostitutes, only the card games would be legal. However, the records show the same people being fined over and over but rarely arrested and shut down. Although the most egregious cases were shut down - there is a notable London case of Elizabeth Broiderer, who was running a brothel under the guise of an embroidery shop and using apprenticeships to lure in teenage girls and trap them in prostitution and got arrested for it - most people who ran illegal brothels just had to deal with the occasional fine so long as they weren't awful to their employees and didn't advertise too aggressively. In theory, prostitution carried a 40 day prison sentence. In practise, it was very rare for prostitutes to go to prison at all, and if they did it was usually for three or four days rather than 40. Most London brothels fronted as bathhouses, concentrated on the appropriately named Cock's Lane. The ward of Southwark (wards were semi-autonomous jurisdictions within the city, like the city's modern boroughs) was the only part of the city to allow brothels, but even then it had to be under the guise of bathhouses. Technically, the legislation isn't even about brothels at all, it's about bathhouses with conspicuously resident women in the apartments upstairs.
So most medieval cities would not have been deserted after nightfall. Quiet, but not deserted. Depending on local regulations, taverns could remain open for a few hours after dark and host all manner of raucous activities along with decent food and drink. Once the taverns closed, people might go to the home of one of their drinking companions and continue there, only to stumble home at 3am. This would be in breach of curfew, but not such a serious breach that it was worth doing much about; the curfew was more about stopping violent crime and organised crime than about stopping John the Tanner from having a good evening. Someone in search of sex could probably find it as long as they weren't outrageously conspicuous about it, and depending on where they lived there might have been a certain part of town permitted to host that sort of nightlife. Many local residents complained about drunken groups making noise when people were trying to sleep, though it didn't anger them enough to snap like William of Grimsby.
Sources:
Barbara A. Hanawalt, ‘The Host, the Law, and the Ambiguous Space of Medieval London Taverns’, in Medieval Crime and Social Control, New edition (University of Minnesota Press, 1999), xvi, 204
Dean, Trevor. Crime in Medieval Europe: 1200-1550. Routledge, 2014.
Karras, Ruth Mazo, ‘The Regulation of Brothels in Later Medieval England’, Journal of Women in Culture and Society, 14.2 (1989), 399–433
Page, Jamie, ‘No Way to Run a Brothel? Prostitution and Policey in the Late Medieval Holy Roman Empire’, German History, 2021
Is there a particular time or place in Europe that you're interested in for this answer? That will help make it easier for an expert to chime in!
This begs me to ask the question, when and where did similar nightlife start in America? Presumably it would have carried over from England to the colonies in the major cities? Most of my colonial knowledge is from New England and small towns, so I’ve never heard of Puritans having such a scene.