What is the right moment to add sugar to make my own coffee liqueur?
I'll try to answer this.

Concerning the first recipe you linked, it doesn't matter at all whether you add it first or not, since there is no extraction going on. Theres no fresh coffee, no fresh vanilla. Just extract, which of course is already extracted, so no extended wait time is needed! There might still be room for improvement, letting flavors 'marry' and so, but I'd say a day should be enough.

The second recipe is different. It steeps fresh coffee in alcohol, and here it's going to need time. One month is however an extreme amount of time. Usually, hot water and coffee is steeped for seconds, and cold water and coffee is often steeped for 12 hours. Consider that alcohol is a stronger solvent than water.
But if going for a true alcoholic extraction, pure is better / faster, so you should steep before adding water, and the sugar probably doesn't make much difference.

This said, I'm not sure you should actually let it steep in alcohol at all, and I'm not sure you should dilute it either.

If I was doing this, I would go for water cold extraction. I'd be concerned that alcohol would extract too much, the same as too long hot water steeping leads to bitter, sour, pungent coffee. I'm not sure why you would want to dilute it with alot of water either. Water adds nothing to the party. Dilute it when using it instead, this leaves you free to choose each time. Perhaps you'd like to mix it with milk instead, sometime?

Do you have a french press? Let 1 part coursely ground coffee steep in 3 parts cold water over night. Use the filter / top to filter it, and pour it into your vodka. I'm not completely sure, but I think 1 part  extract to 4 parts vodka would be fine. Use the same ratio of sugar as in the recipes you linked, or after taste.

UPDATE:

I didn't completely read the second recipe before I answered. It says to boil the vodka-mixture. Sure, the alcohol doesn't vanish in an hour, but I'd still say it's an unacceptable waste (spirits are expensive where I'm from!). Also, the effect is the inverse of destillation, so you are left with a weaker, but sweeter, drink. I'm not sure why it says to boil it. It says that it's to 'thicken the liqueur', but they could just use less water instead.

Good luck!