Night, or nighttime, was the period of time when the sun is below the horizon, with the middle being called midnight. The opposite of night was day, or daytime, which often lasted a similar length of time as the night. On a planet, moon, or other celestial body, the start and end times of night varied based on factors such as season, latitude, longitude, time zone and planet size.
Day and night existed due to the rotation of celestial bodies about their planetary axis. While standing on the world, this created the illusion of the sun rising and setting. Because each planet spun at a different rate, each length of night varied in length. Some planets and moons were tidally locked, and rotated exactly once per orbit, having a permanent night side and day side, such as Remus or Daled IV. Rogue planets, such as Dakala and the First Founders' homeworld, were permanently at night because they had no sun.
Aboard space stations and starships night could be simulated by adjusting light levels. Federation' vessels used an Earth standard 24 hour period.
Night time was often the time for rituals not performed during the day on various worlds. On Earth, nighttime was the preferred time of day for campfires. James T. Kirk, Spock, and Leonard McCoy took shore leave and spent some of their time around a campfire at night in Yosemite National Park, where the three discussed their time together and philosophized about life and death around a pot of whiskey-spiked baked beans. (Star Trek V: The Final Frontier)
On an uninhabited planet up to be explored by Enterprise NX-01 in 2152, only four nights a month occurred due to its binary stars. (ENT: "The Catwalk")
On Bajor every year, the Sirah used a small fragment of an Orb from the Celestial Temple to create the Dal'Rok, which would then threaten the village for five nights. The purpose of creating the Dal'Rok was to unite the villagers against a common foe. (DS9: "The Storyteller")
The holonovel, Beowulf, "an emulation of an ancient English epic set in 6th century Denmark" as described by Chakotay, detailed a town that was visited by mysterious creatures every night. (VOY: "Heroes and Demons")
In the penultimate scene of the first draft script for the Star Trek: Enterprise first season episode "Fortunate Son", Doctor Phlox, in conversation with Captain Archer, referred to Voltaire, revealing he had thought of the philosopher on the previous night and asking Archer if he had ever heard of him, to which the captain replied, "A little."