Students can be better prepared to get the credit they deserve if they know what the APA Ethics Code says about authorship. Standard 8.12 says:
(a) Psychologists take responsibility and credit, including authorship credit, only for work they have actually performed or to which they have substantially contributed.
(b) Principal authorship and other publication credits accurately reflect the relative scientific or professional contributions of the individuals involved, regardless of their relative status. Mere possession of an institutional position, such as department chair, does not justify authorship credit. Minor contributions to the research or to the writing for publications are acknowledged appropriately, such as in footnotes or in an introductory statement.
(c) Except under exceptional circumstances, a student is listed as principal author on any multiple-authored article that is substantially based on the student's doctoral dissertation. Faculty advisors discuss publication credit with students as early as feasible and throughout the research and publication process as appropriate.
Find the complete Ethics Code here.