That really depends on how much time you have and what kind of activities you plan on doing while in San Juan. Generally speaking, a few days is enough to explore the city, as long as you plan your time efficiently.