When do the french say bonsoir?

In the evening, same use as good evening or good night in english