Since Pokémon Gold & Silver, aside from Generation III, the time of day has been a major element of the games with a set period for day and night. However, Pokémon Sun & Moon have changed this up a little, with both day and night now lasting for 12 hours each, running from 06:00 to 18:00 with the visual shift starting at 05:00. In addition to that, Pokémon Moon runs an inverted time so when it's day in real life, it'd be night in the game.
Pokémon Sun & Moon are also the first games since Pokémon HeartGold & SoulSilver to have different encounter tables based on if it is day or night. As such, there are several Pokémon that are exclusive to day and some that are exclusive to night. Some Pokémon even evolve based on it being day or night.
In addition to that, some people only give you items in night, such as TM21 & TM27 in Malie City and Air Balloon in the day in Malie Garden, and certain Zygarde Cells are exclusive to each time of day.
There is one feature that allows for you to switch the time, by going through the portal to the Alt World