Any quest you get has a level associated with it-- that's Blizzard's method of determining which quests you should do at which levels. As listed in the thread:
Grey - Trivial
Green - Easy
Yellow - Somewhat Difficult (Blizzard says "Normal," but some yellow quests are more frustrating than others)
Orange - Hard
Red - Very Hard
(There are addons, also, that will do away with the whole color thing and simply tell you what level your quests are-- I use MonkeyQuest.)
But here's the thing, and this is something I had wrong: every quest you do gives exactly the same amount of XP, unless it's gray. If a quest gives 4000xp, it'll give 4000xp whether you do it at red, orange, yellow, or green. I had previously thought that a red quest would give more XP (because that's how it works with monsters-- higher level kills mean more XP), but that's not the case with quests.
And here's the other thing I learned: while killing a gray mob grants no XP at all, gray quests do give XP, but it drops for every level the quest is gray to you. That number is determined by this formula-- gray quests are 5 or more levels below you, and the XP you receive drops as your level rises.
Finally, while the same XP is given for a quest no matter when you do it, it still might not be worth it to only do green quests-- 1100xp is great at level 17, but not as helpful at 22. While doing red quests won't actually give more XP, they will push that experience bar farther (because the bar is relative to the XP you need for next level). As with mobs, you generally want to be doing yellow quests, while doing orange or red when you can (when you have a group willing to help out) and green when you have to.