Ideally, Yoga should be practiced early in the morning with an empty stomach but everyone has a different lifestyle so you can practice whenever you want according to your own convenience.
Both have their own pros and cons. Considering the same, you can decide when you want to practice it.
It is up to you to choose when you want to practice yoga. Whenever you choose to do it, remember to keep your mind calm and relaxed. The only time when one should avoid doing yoga is immediately after meals. Rest for at least two hours after having food. Any form of exercise right after your meal will disrupt the digestion process.