You can withdraw your deposited assets (excluding boosted portions) at any time during the farming period without penalty. That means that any SP earned up to the point of withdrawal will still count towards your final $SOPH reward allocation at the end of the Ethereum Mainnet farming period. However, you will no longer accumulate SP on the withdrawn assets.