You can do it at any point. If you're just adjusting then you'd include the name change decree with the I-485, otherwise you'd file I-90 to get a new green card with the updated name.
Finally, you can do it while naturalizing, there's a field for it on the N-400.
__________________
LPR these days