Which writing task do you prefer?
Which one is most important?
How long should you spend on each task in the test?
Well, the recommended time is 20 mins on Task 1 and 40 mins on Task 2. Both tasks are important, but most marks are allocated to Task 2 so you need to get a good mark on that to have any chance of getting the overall IELTS score you need.
One way to manage your time in the test is to start with Task 2. That way you can ensure that you spend enough time on it.