Grammar, that is, proper usage of English, is definitely important for IELTS but its importance varies from module to module. Incase of writing and speaking it holds more value as compared to in reading and listening.
Writing and Speaking:
Since a candidate does most of the descriptive work in these two modules therefore grammar matters a lot. Incase of writing the student has to attempt both task one (minimum 150 words) and task two (minimum 250 words) so, it is expected out of him that in his attempt of either , he would be grammatically sound and there would be as few grammatical errors as possible so that he scores well.
Ofcourse other criteria are also taken into account simultaneously like fulfillment of task requirement, choice of ideas and the kind of expression used, before the final score is decided.
The only difference between writing and speaking is that in writing the student can erase or edit whatever he feels is incorrect while revising whereas, in speaking the candidate has to be extra careful while uttering words because whatever is once spoken cannot be taken back and there is an added pressure of being nervous as well as of being recorded.
So, no denying the fact that grammar is important to a great extent in case of these two modules.
When it comes to Reading and Listening, grammatical knowledge comes into play while selecting the correct option, getting a clue regarding the requirement of question and while writing down the correct answer. Most often the answer is as it is given in the passage or is, as spoken by the speaker on the listening CD. However, for some tricky or difficult questions where the purpose of question is to check the grammatical skills of a candidate, while transferring the answer or selecting the right option, a sound knowledge of grammar is needed to get the answer right.