I'm not sure about the correct phrase to say something that has to end before a specific moment. I read that it can be written as: "by + expire time/date". For instance, you can think about doing an essay that has a duty time: "you have to hand in this essay by the 16th of March/by the end of this month". Is it wrong? Thanks in advance
You have to hand in this essay by the 16th of March.
This is grammatically correct and easily understandable.
She's having her housework done by this evening
This doesn't really work. The by is fine, but the use of present continuous doesn't work with it. You normally use present continuous about something that is happening now, or something that is happening around some specified time in the future, for example:
She's having her housework done now
She's having her housework done this evening
You can't really use it for before a specified time. For that, you should use future perfect:
She will have had her housework done by this evening.
With present perfect, the by-time is not only possible but required, so this takes precedence over the optional by-agent clause that might be expected after the passive-voice having ... done. This therefore deals with the double-take issue raised by stangdon in his comment.
The problem with this sentence is that it's easy to get confused by two overlapping constructions:
She's having her housework done = someone else is doing it
She'll have her housework done by this evening = she will finish by this evening.
Because of this confusion, if you need to imply that someone else is doing it and that it'll be done by this evening, then it's best to be verbose:
She's having her housework done, and they will be finished by this evening.