I give you some example in order to help you to understand the differences better .
First 日 ri date of the month, we can both use it for daily speaking and writing but more often for writing than speaking, it is the same means as 号 hao in the sens of day. For example, when you write a diary or a letter, it is better to write as 三月五日 than 三月五号, 号 is used more often for spoken language. In china, spoken language can be used as the written language in some way depends on the situation and what kind of the purpose of the text, but written language has not been used very often for spoken language.
Regarding 天--tian,it means the Periods of timeper. It is a Measure Words for the quantity of the time. The General structure of the Measure word are------Number +Measure word+Noun. For example: 一本书, 一个人,一条狗。But there are some different rules when you talk about the measure word with the time, the nous can be skipped for 天 and some other words which have the similiar usage, for example 年 and so on. 天 have two part of speech,it is not only a noun also a measure word as well. so you can say one day as 一天。 For example, 我等了你一天/ 一整天*(整 zheng means full , more stronger expression)。I waited for you a whole day.
In my opinion it is one the most difficult part for many foreigners from my past working experience as a professional Chinese teacher in different country. Thanks