If the light is on, it means that the establishment is open and welcoming customers, if it is off it means that the house is closed for the moment or that the people are busy.
The use of a red light in the world of prostitution goes back a long way, without knowing precisely when and how it became the symbol. One theory says that prostitutes in the 17th century wandered the streets lighting themselves with a red lantern, because this color had two advantages: it made them easily identifiable by sailors who had just landed and were looking for a little company for the night ... but above all, it allowed them to camouflage imperfections on their faces (in other words: traces of syphilis)