How long do you have this problem? -- Ungrammatical.
How long did you have this problem? -- This is correct English, but it refers to a period in the past and implies that the person no longer has the problem, so doesn't fit your criteria.
How long have you been having this problem? / How long have you had