Is it recommended to invest in stocks as a typical broke graduate students?
Don't even think about investing until you've saved an emergency fund enough to cover at least 3 to 6 months (and perhaps a year) of living expenses.

Due to exponential growth, investing earlier does have huge advantages, but for PhDs in many fields you make more than enough after PhD that you will be able to invest enough to retire comfortably even if you save nothing before you get your PhD, so there's no reason to be stressed about this until you graduate.  And you may need your emergency fund for the time between graduation and your first job.  Once you have your first job out of graduate school and have saved an emergency fund then you can think about this.