Saying "What did you do used to do when you where a child?" sounds incorrect grammatically.
It contains following errors:
- Repititive in using the verb "do".
- Using -d in "Used to" even after "did" [if you write it in written exams, it's incorrect].
- Use of unsuitable word "where" rather than using "were".
Instead say: What did you use to do when you were a child? [don't write "did you used to" in written exams, though it's acceptable in other cases].
Your second sentence is also wrong. We can't say "How long can you studied English?" because it's incorrect to use past form of the verb "study" [as studied] before we use auxiliary verb "can".
It will be correct to say:
- How long can you study English?