For how long can I visit USA without visa?

I have a Spanish passport (Europe) and I would like to do an academic visit to a research center in the states. The grant is for 3 months and I am wondering if it is enough the ESTA to carry out the visit, taking into account that 7 months ago (last year) I visited the states for 12 days. If not, what would I need? Thank you.