Let A be the amount of hours that Juan can study for Algebra and C the amount of hours that he can study for Chemistry.
Since the total amount of time that he can study is 24 hours, then:

Since he will study Algebra three times as long as he will study Chemistry, then:

Then, a system of equations that represents this set of conditions for the study time, is:

This system can be solved using the substitution method. Replace A=3C into the first equation and solve for C:

Replace C=6 into the expression for A:

Therefore, the system of equations that represents the given situation is:

And the solution says that Juan has 18 hours to study for Algebra and 6 hours to study for Chemistry.