The first sentence, "I didn't have a break for a long time," is in the past simple tense. It suggests that there was a specific point in the past when you did not have a break for a long time, but it doesn't necessarily provide information about the current situation.
The second sentence, "I haven't had a break for a long time," is in the present perfect tense. This sentence indicates that the lack of a break has continued from the past up until the present moment. It emphasizes the ongoing nature of not having a break.
In summary, both are grammatically correct, but the choice depends on whether you want to focus on a specific point in the past (past simple) or highlight the ongoing impact from the past up to the present (present perfect).