I’ve read few articles about spikes in Scrum. In general there are recommendations to estimate spikes with story points and define acceptance criteria, pretty much as normal user stories. What is not so clear for me is if a spike has not been finished within a given sprint, does the incomplete spike cause the sprint to fail?
[I]f Spike has not been finished in a given sprint does it cause a sprint failure?
No. Spikes are generally complete or incomplete. A spike (almost by definition) very rarely "fails," and the status of the spike generally has no bearing on the current Sprint Goal.
What Story Spikes Teach the Team
The primary purpose of a spike is to learn something about the size or complexity of a related story. For example, if you are planning to build a database with a new DBMS, you might have a story spike to stand up a new, throw-away instance of the DBMS and seed it with some basic data to get a sense of how much effort it will take.
If the spike is successfully completed within the time box, then the team gains knowledge and a better understanding of how hard (or easy) the real story may be. On the other hand, if the spike is not successfully completed within the time box, the team still gains knowledge, but the knowledge may simply be that there were more variables or complexity than the team had planned for.
An incomplete spike is still useful. It generally helps a team plan and estimate better, and may lead to more spikes or finer-grained stories in future sprints. It may also lead to rethinking an approach entirely, which is also a very useful thing in an iterative process.