If just changing chainring, the chain goes halfway around the chainring so you halve the difference in teeth, err on the side of longer just in case....
If swapping the biggest gear on the cassette, you can get fancy by adjusting chain length to get ideal derailieur angle - then stuff it up and...