You must be talking about Epigraph.
The formatting of epigrams varies widely. Refer to the relevant style guide for your publication.
Broadly speaking, this guidance from an APA style editor, How to Format an Epigraph, can suit most purposes.
The text of the epigraph is indented from the left margin in the same way as a block quote. On the line below the end of the epigraph, the author’s name (and only the author’s last name if he or she is well-known) and the source’s title should be given. This credit line should be flush right, preceded by an em dash. An epigraph’s source is not listed in the References section.