Konbanwa is used to greet someone anytime in the evening, but oyasumi is strictly used for when you want to go to bed and sleep.