Interns from most countries do not require a visa if the internship lasts less than 90 days. Internships that last longer than 90 days will require a study visa. To apply for this visa you need to contact the Spain embassy. The following documents will be required:
Most internships in Madrid are unpaid. If your internship happens to be paid. You will always need a visa.