Ability — if it's about ability, "talk" is preferred: "cats can't talk", "when I'm drunk I lose my ability totalk". Note that "speak" is allowed but is less popular;
Languages — use "speak": "I speak English";
Action — covered in answers above; both words can be used; "speak" is mostly about single-direction, while "talk" usually refers a conversation (and is less formal);
Express information — use "say" or "tell": "I told her that I love her". Here, "I love her" is the information being expressed. "Say" can also be used, but it connotates a single-time action. Compare: "I said that the discussion is over and hung up the phone."
Imperative usually follows the rules above, but due to an extended popularity, here's a brief:
Extended time or dialogue — "Talk to me."
Long monologue — "Tell me about your problem."
Short monologue — "Say something!"
Requesting a certain attribute of speaking process — "Speak slowly please."
LanguageLearningBase.com (short:llb.re) is an online community for learning foreign languages. It represents an open knowledge base. Every member can share and gain knowledge about a new language.
Difference between SAY, TELL, and SPEAK
Imperative usually follows the rules above, but due to an extended popularity, here's a brief: