Sounds like you have not applied for I140 yet. My guess is your green card application will be employment based. If that is true, then you cannot quit your job because your green card application is based on your employment.
There is no rule against H1b enrolling in class and get a degree. If you are capable of doing both, that is, hold a full time job and go to school, then go for it. One thing is a PhD degree requires a lot of time but you also have a lot of flexibility on your schedule too.
There is also no rule saying H1b has to be on full time employment. Part time H1b is possible. So if you work something out with your employer to go on part time then you can go to school on a part time basis too. But keep in mind being part time employed will have negative impact on your green card application.