It is still not very clear to science what sleep is all good for, and why it has evolved, but since it so ubiquitous, it is only fair to assume that it is absolutely necessary for somewhat higher brain functionality (though research indicates that even simple flies have a state that could be described as sleeping).
Depending on what research you follow/believe, sleep seems to serve some purposes:
- Save energy for the part of the day where you can not do much useful (humans are bad for hunting in the jungle at night)
- Repair chemical/neural "damage" done during the use phase of the brain
- Reinforce learned knowledge (It is somewhat controversial how it is done, but people seem to agree that it is being done)
So for the energy save part, looking at mammals that rest or sleep through a winter, we can safely assume that from the energy perspective adapting to a week or even a month sleep can work for humanoids.
If you ever had the opportunity to stay awake much longer than 24 hours (say 50 or 60) you notice that your brain pretty much malfunctions (or you don't notice, as part of that malfunction). This gets much better when you do some power naps. I am confident that evolution could work its way through all this getting tired and accumulating bad stuff in your brain that gets cleaned up later. Enough to stay awake for a week, not so much for a month though.
The learning part though is a tough one since you would accumulate a week of stuff in your short term memory which will then get sorted over one week of sleep into the long term memory. This makes you require quite some short term memory and has quite some long turn around time for efficient learning. So either the species isn't that efficient at learning, or it has some shorter sleep cycle that is being used for this.
This would be in contrast though to the inability to properly cope with predators that hunt at day and would find you lying around and sleeping.
My idea for this would be a highly segmented brain and a very social structure.
Just like with dolphins, the brain will sleep partially, but not only two parts, but maybe four. During that time you are basically in some kind of "autopilot" mode, being able to do simple things like walking, but not more complex stuff. Additionally the social abilities of the humanoids organize themselves around these states of mind, so that if e.g. a group of them are traveling some are in autopilot and others take care of them.
Given that the social abilities of humans are a great part of their evolution, I think this would be a pretty likely scenario for humanoids to evolve for a week or month of day. With increasing intelligence and use of tools, they would probably evolve similarly for the night.