As explained by Wikipedia, "Moors" are not a self-defined people, or reference to any one ethnicity, but a name used by (Christian) Europeans according to their own logic.
In the context of Spain, interestingly looking up the Royal Spanish Academy dictionary entry for moro gives us useful clues:
- It is derived from the Latin "Maurus", in turn from Greek Μαῦρος "dark", which referred to the people of the Mauretania, an area roughly corresponding to today's Morocco and Algeria. They were called that due to their darker skin compared to Europeans.
- Definition (1) and the related (2) in the dictionary refers to the people from "North Africa bordering Spain". This definition closely follows the original Latin definition.
- Definition (3) refers to Muslims in general, but definition (4) and the related (5) refers to Muslim inhabitants of Spain "between the 8th and the 15th centuries". Note that this now includes Muslims native to the peninsula, who might or might not be dark-skinned or ethnically distinct from the Spanish Christians.
These definitions would later be expanded to cover more cases (e.g. Moros in the Philippines, or Indian "Moors" as called by the British, even any dark-skinned person in general). But for European context up to the medieval era, I believe the above definitions mostly suffice.
To cover corner cases brought up in comments and other answers:
- Christians and Jews of Spain did not meet any of the above definitions (unless they come from or were associated with North Africa), so they were not called Moors as per SJuan76's observation.
- Christians could be Moors if they're from North Africa, using the second definitions above. This explain Benedict the Moor as brought up by T.E.D.
- I'm not sure what definition Shakespeare had in mind, but even if heOthello was baptized he might still be a Moor in the sense of "North African" or even "dark skinned".