Two days are enough if you plan to visit the architectural ruins and temples of Hampi.  However, you need to ensure that you follow a strict schedule so that you're able to cover all the places in 2 days. This is because some places require more time to cover compared to others. Also, ensure that you're hiring a guide to give you context about the history and architecture of all the ruins you visit in Hampi.