You asked about whether we need "the" in the following phrases:
1)in the early 2004(meaning "at the begining of 2004")
2)in early 2004
3)in the late 2004
4)in late 2004
Only#2 and #4 are correct.So, the answer to your question is,no,we cannot use "the" in thses pharses. However, we do use it in the following:
5)in THE early PART of 2004
6)in THE LATTER PART of 2004
And we also have:
7)EARLY in 2004
8)LATE in 2004