Now THAT's a quite complex simple question. Short answer, any time as long as there are active yeast to ferment it. Long answer, depends on what I'm trying to do with the sugar. If all I want to do is thin body (and add alcohol), it goes into the boil. Technically I could add it to the mash but then I'm leaving some of it in the draff. If I'm really thinking about it, I wait for high krauesen and add it then, generally by making a syrup, boiling it to sanitize, cooling it and dumping it in. I've added fruits (sugars) to secondary and of course, there's priming. So there's really no simple answer. If you'll tell us specifically what you'd like to do, we could likely give a few more targeted opinions.