The correct option is
D to leave
The verbs that do not explain the tense of the sentence and do not agree with the subject are called non-finite verbs. Non-finite verbs are usually infinitives, gerunds and participles.NOTE: Some main verbs are often followed by an infinitive. For example: Do you want to eat an ice cream? Here, 'want' is the main verb and 'to eat' is an infinitive which doesn't explain the tense of the sentence.
Option A - 'Leave' can't be used here as we need an infinitive to follow the main verb 'forget'. Hence, option A is incorrect.
Option C - As 'forget' is already in past tense, we don't need another verb in past tense 'left'. Hence, option C is incorrect.
Option D - 'To be leaving' can be used in passive voice only. As the given sentence is in the active voice, we can't use 'to be leaving' here. Hence, option D is incorrect.
Option B - 'To leave' is an infinitive which can be followed by the main verb here. It is a non-finite verb as it doesn't explain the tense of the sentence and it doesn't even agree with the subject. Hence, option B is the correct answer.
'Don't forget to leave some money for me on the table.'