How do you get the history of a painting?

The history of a painting, or of any art object, is called its provenance. World famous objects usually have their provenance in suitable books on the subject. An art gallery will (or should) have the provenance of anything it sells. Hope this helps.