I thought how immature I am; though strictly speaking, you should write "I thought how immature I was", as this is an occasion of reported speech (or thought in this case). It would be correct to write: I thought “how immature I am”, using the inverted commas as shown.