Limit of related substances

How to set a limit for related substances and residual solvents for a non-pharmacopoeial drug product?
(Please don’t quote any guidelines, I want to understand the process.)