How important are my grades to the rest of my PhD career?
As far as your research stature is concerned, grades would matter least of all, below other non-academic stuff as your soft-skills, your personality etc. There are a number of reasons for this:
No one cares about your GPA once you are a researcher! While it certainly looks nice to have a stellar GPA, it's the work that you do and where you publish that would matter. Look up some resumes of notable faculty in your field - how many even list their MS/BS grades?
I might even say that your adviser would not be too happy if you have a 4.0 GPA - as it means you are spending time on perfecting your grades which is more profitably spent on research! I actually have read this on a faculty/university webpage - would post the link once I dig it up. EDIT: Haven't found the faculty website link yet, but here's a couple from an established source, phdcomics - enjoy!
PS: I'm actually waiting for JeffE to comment on this: His credentials are such that I'm not even qualified to state them, and he himself claims that he had the lowest undergraduate GPA amongst any professor he's ever met!
EDIT: I'm talking about grades in subjects that you have to take as part of requirements of grad school - you would be expected to master the subjects that are directly required in your Ph.D research thesis, so your adviser would expect great grades in them naturally!
tl;dr - They don't matter (as long as you clear all your subjects!)
To be a bit blithe about it, grades matter until they don't. When you are a PhD student, the grades will matter until after you've completed your "qualification" process, in whatever form that takes. If you do well on the exams, then your grades don't matter much; if you're "on the bubble," you might be helped by solid performance in your graduate coursework.
Where grades continue to matter are:
- if you decide to apply for a graduate fellowship, in which case review committees will usually want to see evidence of strong academic performance at both the undergraduate and graduate levels.
- when you apply for jobs, as employers will similarly want to see evidence that you took coursework somewhat seriously. (Some employers may—wrongly, in my view—have GPA cutoffs for graduate students!)
Just to note one place where they do matter: they may help you find a willing advisor. I am not inclined to take on students who don't do outstanding work in the first-year graduate course that I teach. On the other hand, students who are at the top of the class may find faculty trying to attract them.