Very important. You will learn a lot from them.
Recently, when I visited TIFR-Hyderabad I was asked to meet with a group of graduate students for a question and answer session on career issues. This was actually the first time I have actually done something like that. The students had many excellent questions. Some I may later blog about. Here I will just focus on this one question.
Getting a Ph.D is not just about writing a thesis or even going to classes, doing experiments, talking to your advisor, and passing exams.
At every stage of a program you can learn an immense amount from informal interactions with your peers [your class cohort]. Each has different background, interests, expertise, strengths, and weaknesses. Talking with them and sometimes working together on joint projects can be immensely valuable. Just the art of learning to talk to each other, asking questions, and crossing specialist boundaries [theory vs. experiment, chemistry vs. physics, field theory vs. condensed matter, soft vs. hard condensed matter] can be a rewarding but slow process.
Peers can also provide significant feedback and emotional support.
For some of us this may mean taking risks, overcoming shyness, and not making comparisons.
In reality, you may actually learn more from your peers than from the formal part of the program. Some people also develop lifetime friends and/or collaborators from their cohort.
If I had my time over again I would have interacted a lot more with my peers. At the time I just did not realise how valuable it could be.
This is why I think you are much better off in a Ph.D program that
-is highly ranked
-has a reasonable size cohort [10 plus new students per year]
-has a significant course work component
-provides on campus shared accomodation
-encourages informal interactions including shared offices that mix up research groups
-encourages interactions across groups and departments.