You can apply after the first half of the semester. Of course, you'd better study hard and get higher grades.
At this time, of course, the teachers in the department will not want you to leave, but will do everything possible to hinder you, telling you some conditions and possible disadvantages of changing majors, saying that graduation may be delayed, and you must score 80 points in each exam to qualify, and so on. Leave him alone and apply decisively.
Then take the exam, and you will basically succeed.
good luck