The basic primis is any contraction; can't, I'm, you're, I'd (etc) is informal speach and writing. In any formal writing you would not use any form of contractions. I don't know about formal speach as I tend to try and keep away from any kind of "formal" occations that would require a different speach edicat. (what can I say, I'm a computer geek and formalities aren't my forte)