When should you use kein and when should you use nicht?
As a quick rule I suggest to keep an eye out for the negated word. Non-Nouns are usually negated with "nicht" and nouns by "kein, keine etc.", except for the ones accompanied by pronouns (like: her, his, their) which go by "nicht" as well.
Nouns (without pronouns): kein Apfel, kein Geld, keine Hose; Nouns (with pronouns): nicht ihre Schwester, nicht sein Auto, nicht deine Hose; Everything else: nicht groß, nicht klein, nicht hier; Hope I could help.
Whereas the English prefer sentence negation through the use of "not", the Germans prefer to negate through the use of the negative indefinite article "kein", which must reflect the grammatical gender, the grammatical case, and grammatical number of its noun. Thus, "I have no apple" = "Ich habe keinen Apfel" or "I do not see ducks" = "Ich sehe keine Enten". Please use the indefinite article "kein" (rather than "nicht") if a noun can be negated with it.
As written by Patros, non-nouns are usually negated with "nicht", whereas nouns are negated by "kein/keine" if they are not preceded by possessive pronouns (e.g. my, your, his, her). When you want to negate a whole action you have to use "nicht", for example "Ich komme nicht" = "I'm not going to come/ I'm not coming". If you want to translate "not...anything" or "nothing" you have to use "nichts", for example: "I don't see anything"= "Ich sehe nichts."
I like the explanation that if it is a general thing (a) use kein, if it is mentioned before (the) use nicht.
I have no bird = Ich habe keinen Vogel.
I do not have the bird = Ich habe nicht den Vogel.