Explanation
"Will have finished" is future perfect tense.
It used for an action that will be completed before a specific time in the future.
The phrase "By the time I go to bed tonight" clearly indicates a future time limit, making this tense appropriate.