If you hold an American passport, you can stay in Spain for up to 90 days within any period of 180 days without a visa under the 90/180 rule. However, if you plan to stay longer than 90 days, you'll need to apply for a Spanish D visa, which comes in different categories depending on the purpose of your travel.