Analysis vs. Doing Something

How long should a team spend analyzing something before doing something? A team I work with recently used a "spike" to investigate how to implement a new system capability. The spike was open for two sprints, although I am not sure how much effort was expended over the course of those two sprints. The fact of this spike being open for two sprints made me curious about the trade-offs madeā€¦...