noun
31st day of the month
Refers specifically to the 31st day of a month. Used in dates.
3月31日は年度末です。
March 31st is the end of the fiscal year.
彼の誕生日は12月31日だ。
His birthday is December 31st.
noun
31 days
Refers to a period of 31 days. Often used when talking about months that have 31 days.
1月は31日あります。
January has 31 days.