You use buenas noches as ‘good evening’ when it is dark. You can also use buenas noches as ‘good night’ when you go to sleep.