To help answer that, I'll start with a look at the broader country (and by extension, world), which is primarily my answer from a similar question on Physics SE, slightly adapted:
It's good to start with some foundation on what time of day lightning is most often seen. Here is a plot from Global electric circuit implications of combined aircraft storm electric current measurements and satellite-based diurnal lightning statistics (Mach, Blakeslee, Bateman: 2011)
And to add a better idea of how much regional variability is involved, this plot of peak lightning time from Cloud-to-Ground Lightning in the United States: NLDN Results in the First Decade, 1989–98 (Orville and Huffins: 2001)
The summary is that the majority of places see peaks during the afternoon, but there is variation, including perhaps a few parts of New York.
Generally, the mechanism responsible for the majority of storms heavily determines when peak times occur:
- Devoid of other overwhelming factors, the afternoon will generally be favored in most areas. This is because that is when peak atmospheric heating occurs. To form a thunderstorm, air must rise until it can attain a level where it has cooled to being saturated. Without external forcing mechanisms, the air rising must start warm and moist enough to reach this point. This instability peaks during the daytime. Nighttime air is indeed typically closer to being saturated (has a higher relative humidity)... but that is caused by the ground cooling; this cooling causes an inversion of warmer air in the profile aloft, which further blocks rising motion. Plus at night there are no longer the thermals created by the ground heating that are often the source of the lift itself.
Many regions indeed have these predominantly airmass thunderstorms, where most storms are found when warm-season airmasses reach their convective temperature during the afternoon (seen in places such as the interior southeast US). For much more details into this lift process and all of these terms, this reference may prove helpful.
- Areas nearer warm coastlines are often heavily biased by the sea breeze circulation. Areas 50-100 miles inland would peak during the early or mid afternoon (see Florida). Spots further inland may actually see a lesser (usually secondary) peak later into the evening because the (less common) deeper penetrations take longer (seen in places like central Georgia). And locales right along the coast may see noctural peaks due to nearshore landbreeze storms (see right on the Gulf and Atlantic coasts).
- Regions dominated by synoptic storm systems will be biased by their relationship to the common development areas. Areas should peak during the day if near where storms in these environments typically develop (often along mountain lees). As those storm progress (eastward in the NH mid-latitudes), they often grow upscale into squall lines or MCCs, such that in those areas further east, at least secondary peaks may be seen later into the evening or even night as the storms often move that way during this time period (can often see this in many parts of the Mississippi Valley).
- Some areas are heavily influenced by overnight low-level jet storm development, and thereby peak during the night (such as the Great Plains).
- As Sip noted, far out over sea, at least in warm areas (doubt there's much lightning over cold oceans!), the atmospheric profile is often more moistly saturated, leading to weak instability that can be more reasonably tapped any time, and thus a more random spread of convection times. I don't have much history working on convective storms in remote ocean locations (do that many people!)... but I tend to imagine there's just not much lightning due to the weaker lift. But regardless, it ties into one related interesting topic at least: the diurnal radially increasing peak of lightning found in tropical cyclones over the ocean.
One last factor that may impact our own experience is the reality that lightning is visually less distinct to us during the daytime. Lightning can regularly be seen for hundreds of miles at night (often given the misnomer heat lightning), whereas during the day, unless the sky is particularly dark or the actual channel is directly observed, often we'll only notice the thunder.
But indeed, while lightning varies greatly geographically, overall it peaks during late afternoon due to the nature of convection, and aided by many of the local mechanisms that drive it.
Now, as to western New York, the NLDN reference
also included flash density:
Showing you're pretty limited in your lightning up that way. But the time map does show some locations in western New York are more night-focused than many places in the US.
Looks like it's heavily caused by the lake. Over the lake the cool lake air should squash instability of incoming storms on warm afternoons. Lake breezes might extend that lull somewhat further inland, though it would also feasibly kick off storms as they advance, too. But I really doubt lake breezes up that way often get deeply developed enough to move inland and have a lot of influence during the summer. I don't see any radar evidence over the past few days of any.
Thinking some of the late-night lightning further inland, especially along the Tug Hill, might actually stem from the major lake effect snow events. I'd think that such events might often be strongest at night because air-lake temperature difference is vital to LES, and temperatures are lowest at night of course (winds often slacken at night, potentially mitigating this, but I believe most LES, especially on the eastern shores, come in situations with strong synoptic flow, where nighttime wind decrease shouldn't be much of an issue).
Not sure if you get enough thundersnow to really sway the needle towards night-time lightning. Maybe as you cool at night, storms fire over the lake at night, equivalent to landbreezes. Seems it may be a combination of factors that cause your fairly local peculiarity, but hopefully these ideas/factors offer at least a bit of insight!