How to draw text on a material

Can you explain how to do so? or show me an example of it?