Hola Emanuel
It's the same as in English, it goes with what you are really saying.
I got a 10 percent discount on the sale.
Me dieron un 10 % de descuento en las rebajas.
But:
10% of the population voted against.
El 10 % de la población votó en contra.
Here you don't have an article in English but this is part of the subject so it takes the definite article in Spanish.
Although you could also say:
A 10% of the population voted against.
Un 10 % de la población votó en contra.
So, it all depends on what you're saying each time.
Saludos