I think the answer is that it does vary according to park hours and number of guests, but that there are certain trends. I think there are very few options after midnight. I think about the only exception seems to be room service at the Deluxe resorts which advertise 24hr. room service. I think most of the other resorts have pizza until 1am. The parks will have SOMEthing open until park close, but lots of places close before that, especially in the farther parts of ther parks. In Epcot, for example, the park hours are always 9 - 9. The WS restaurants stay opne until 9pm, but the QS start running low on stuff after 8pm. The WS says it closes at 7pm, and I'm fairly certain all the restaurants close at 7pm in that end of the park. There used to be a cookie/coffee stand near WoE that was open later, but I thik they have a more limited menu now. Likewise, all concessions used to close at park close - even during EMH, but I think some restaurants may have the option of staying open later. It was my recollection that Mexico's QS stayed open a little into EMh, but only like a half hour or so.
One exception seems to be the shops on Main St. They stay open a llittle later than park close, but not for all of EMH either.
The Ice cream cart vendors close up, I think about an hour before park close, but a few popcorn vendors stay open until park close. I recall the popcorn cart near Space Mtn. being open pretty late, but the fruit vendor (LibertySquare) being closed after dark - I think. The popcorn cart in Fantasyland closed before the one in Tomorrowland, but I couldn't say when exaclty.
Conversely, Not everything is open in the am either. WS doesn't open until 11am. the only exception I think is the Princess breakfast in Norway. I also know Fountain View doesn't opne until 11 or 11:30. The food court in the Land has breakfast though. The ice cream shop in Main St, I think opens at 10:30 am. It was pretty early for ice cream. The resort QS places opne up pretty early- I think like 6am, or maybe 6:30. So you cna send someone to fill up your refillable coffee mug pretty early. Also, inthe parks, some of the food places offer a limited menu in the morning. Like the orange ice cream place outside the Tiki hut doesn't have ice cream in the am, but they do have coffee and maybe like muffins or somthing. I know I got something there, I can't recall what it was. the coffee wasn't very good though. The coffee at teh cappucino carts near the castle were much better (if a little more pricey).