Can Mass be celebrated at any hour of the day? In the Eucharistic Prayer III, we read:


  You are indeed Holy, O Lord, and all you have created rightly gives you praise, for through your Son our Lord Jesus Christ, by the power and working of the Holy Spirit, you give life to all things and make them holy, and you never cease to gather a people to yourself, so that from the rising of the sun to its setting a pure sacrifice may be offered to your name.


I believe the above is somehow linked to the Jewish practices of sacrifices, which seem to have taken place between the morning and the evening. For instance, in Exodus 29:38-39 we read:


  This is what you are to offer regularly on the altar, each day: two lambs that are a year old. In the morning offer one lamb, and at twilight offer the other. 


Is the above implying some restriction regarding the times in which Mass can be celebrated? Mass can be normally celebrated as early as 6am, and throughout the day. The latest mass I'm aware of is celebrated at midnight - the Midnight Mass, in Christmas. Is is possible for a Mass to be validly celebrated at, say, 3:00 am?
Can Mass be celebrated at any hour of the day?

The short answer is: Yes, if there is a valid reason for it.

Masses can be said at any time day or night if there is a real necessity or spiritual need for it.

This answer will be based more on actual experience than with concrete sources. For some reason rubrics on this point are quite hard to locate for those who follow the Ordinary Form of the Mass (OF). Geremia gives a good answer, but the references treated are in reference to the Extraordinary Form of the Mass (EF). I can not locate any guidelines for the New Mass. 

Yet the rubrics that Geremia lays out could also be altered by some real need, circumstance or local custom.


  Under certain circumstances rubrics may be modified by custom, but in this respect they do not differ from laws in general. - Rubrics


I spent some 20 years affiliated with religious communities that say both forms of the Mass used in the Latin Rite. It is not uncommon for a priest in a religious community to say Mass extremely early because of the necessity of driving a great distance that day. This applies to both Forms of Mass of the Roman Rite.

New Years Day may be celebrated at midnight too. We had Mass celebrated by an Abbot in the Extraordinary Form on New Years Day 2000 as a way of welcoming in the New Millennium. I am sure some priests still do this. 

In the monastery I stayed in for several years, one priest was assigned the task of saying Mass at 4:00 AM, so that the Brothers could be free to go and milk the cows. They called this the Farm Mass.

I can not tell you how many times I served a Mass (of either Form) between 2:00 AM and 5:00 AM because a priest (Religious or secular) had to leave on a long trip on that particular day.

Thus Mass may be celebrated at anytime day or night, if there is a valid reason for doing so. And that goes for both Forms of the Mass (OF and EF) in the Latin Rite.