It's quite a complex area, but here are the basic ideas:
I would like to know when the definite and indefinite articles are used
Here are some examples and explanations.Originally Posted by diogo
a = indefinite article (not a specific object, one of a number of the same objects) with consonants
She has a dog.
I work in a factory.
an = indefinite article (not a specific object, one of a number of the same objects) with vowels (a,e,i,o,u)
Can I have an apple?
She is an English teacher.
the = definite article (a specific object that both the person speaking and the listener know)
The car over there is fast.
The teacher is very good, isn't he?
The first time you speak of something use "a or an", the next time you repeat that object use "the".
I live in a house. The house is quite old and has four bedrooms.
I ate in a Chinese restaurant. The restaurant was very good.
Hope that helps.