良い is used for "good" in general. Like in good person, good friend, good question, good feeling, good score, good day, or whatever good.
善い is used only for some behavior/person which is right and good in the view of morality and humanity.
For example, you can write "Good Samaritan" as either 良きサマリア人 or 善きサマリア人 (「善き」is old way of writing「善い」, if you are concerned). But you can write "good question" only as 良い質問, not 善い質問。