In what ways can a PHD student who asks me to do some of her work give me due credit for my work?
She should mention your contribution in the acknowledgments section of her thesis and the related article(s) she might publish.

Additionally, she could provide monetary compensation for your time. Or, as per Dan Neely's suggestion, she could arrange that you receive academic credits or that your work counts as one of the requirements for getting a degree. This is only applicable in a subset of situations where you are pursuing a degree and where the involved institutions are willing to do so. 

In response to comments arguing that you should get co-authorship, or that you could bargain authorship instead of a salary, I'm copying the authorship guidelines of the ICMJE:


  The ICMJE recommends that authorship be based on the following 4 criteria:
  
  
  Substantial contributions to the conception or design of the work; or the acquisition, analysis, or interpretation of data for the work; AND
  Drafting the work or revising it critically for important intellectual content; AND
  Final approval of the version to be published; AND
  Agreement to be accountable for all aspects of the
  work in ensuring that questions related to the accuracy or
  integrity of any part of the work are appropriately investigated and resolved.
  
  
  In addition to being accountable for the parts of the work he or she has done, an author should be able to identify which co-authors are responsible for specific other parts of the work. In addition, authors should have confidence in the integrity of the contributions of their co-authors.
  
  All those designated as authors should meet all four criteria for authorship, and all who meet the four criteria should be identified as authors. Those who do not meet all four criteria should be acknowledged.