If you’ve become a 401(k) millionaire or amassed large sums in other tax-deferred retirement accounts, you can potentially shave your lifetime taxes by hundreds of thousands of dollars by converting part of it to a Roth IRA before you start collecting Social Security. But figuring out how much to convert—and when—is a tricky exercise.