You use them depending on the declension of the noun. In the case of the word "red", you use "rød" with words that are fælleskøn (those that take "en" as the article - also called "common gender" in English), "rødt" with words that are intetkøn (those that take "et" as the article - also called "neuter gender" in English), and "røde" with plurals or definite articles:
"en rød bil", but "et rødt hus"
"den røde bil" and "det røde hus"
"røde biler" and "røde huse"
You are correct in your assumption that the same pattern is found for other colors, and indeed most adjectives. For "green" you have "grøn", "grønt", and "grønne", and for "white" you have "hvid", "hvidt", and "hvide". Hope that helps!