A week will do just fine in Cancún [1], allowing time enough to get your tan on, plus take a day trip or two, such as to Isla Mujeres [2] or one of the nearby Maya ruins. Ten days gives you time to explore deeper and farther, turning a day trip to Isla Mujeres or the Maya ruins into an overnighter, or venturing north to the remote island of Isla Holbox [3].
Isla Mujeres and Isla Holbox are quite small but wonderfully relaxing; if either is your main destination, budget three or four days to experience them fully, but don’t be surprised if you end up staying longer.
Cancún, Isla Mujeres, and Isla Holbox all can be reached and navigated by bus, ferry, taxi, and on foot—no need to rent a car. Same for destinations along the Riviera Maya [4], although a car will help you maximize your time there.
You definitely should consider getting a rental car, however, to see the Maya ruins near Cancún. Being able to arrive early at the big sites or visit some of the smaller ruins makes an inland excursion significantly more rewarding.
Links:
[1] http://www.moon.com/destinations/cancun-the-yucatan/cancun-cozumel-and-the-riviera-maya/cancun
[2] http://www.moon.com/destinations/cancun-the-yucatan/cancun-cozumel-and-the-riviera-maya/cancun/isla-mujeres
[3] http://www.moon.com/destinations/cancun-the-yucatan/cancun-cozumel-and-the-riviera-maya/cancun/isla-holbox
[4] http://www.moon.com/destinations/cancun-the-yucatan/cancun-cozumel-and-the-riviera-maya/the-riviera-maya