How do bats distinguish between day and night? Do they hunt at night - if yes, how they know that?
Are they afraid of sunlight?
Bats distinguish day and night the same way that other animals do, with an internal circadian clock and by environmental cues (dawn and dusk).
Most bats (over 1000 different species total) are nocturnal, meaning that they are out of their roost and foraging at night. This includes that vast majority of bats, which also echolocate. Some bats, notably pteropodid "Flying foxes" are diurnal, meaning they are active during the day and sleep at night, like humans. These bats are typically fruit-eating. There are, of course, exceptions, but these general patterns hold.
Bat Conservation International has good educational information about bats.