When I pray for someone's conversion and God gives him the grace to convert but he/she rejects it. He won't end up converting and constantly is rejecting God's grace. I can see that God was putting these people in situations where the conversion could have happened but they resisted and kept on living their way of life.

Will this grace be assigned to somebody else? Will it be wasted? What is the Roman Catholic teaching on this matter?

For example, when we pray for souls in purgatory God can assign our prayers to different souls if he things the souls who we pray for can't receive it. Does this happen when we pray for people on Earth?