What is the best time to prune my potted lemon tree?

Kat
by Kat
I would like for it to be more compact, it's all spread out. I've had it for 10-12 years. It has lemons on it now. How is the best way to cut it back and the best time of the year. Thank you