The denominator doesn't really have to be 36. An easier way(for me, anyway) would be to convert 1/3 into 4/12 by multiplying the top and bottom by 4. Then, add 5/12 and 4/12 to get 9/12, which simplifies to 3/4 when you divide the top and the bottom by 3.
Another way is to multiply the top and the bottom of the first fraction by the denominator of the second, and multiply the top and the bottom of the second fraction by the denominator of the first(I'm using "denominator" and "bottom" the same, by the way). So, multiply the top and bottom of 5/12 by 3 to get 15/36. Then, multiply the top and bottom of 1/3 by 12 to get 12/36. Then, add 15/36 and 12/36 to get 27/36, which simplifies to 3/4 when you divide the top and the bottom by 9.
The first way only works when one of the denominators(3) is a factor of the other(12). The second way works every time. That's probably why the denominator had to be 36; your teacher wanted you to do it the way that always works.