One day: the essentials
The monuments sit close together and most can be walked. In a single focused day you can see the Shore Temple, the Pancha Rathas, Arjuna's Penance, Krishna's Butter Ball and the main cave temples. This suits a day trip from Chennai.
Two days: town and coast
A second day lets the trip breathe. Add Mamallapuram beach, browse the working stone-carving studios the town is known for, visit the Tiger Cave a few kilometres north, and — in season — catch an evening of the dance festival.
Three days: reach out along the coast
With a third day you can make a day trip down the ECR to Pondicherry, or inland to the temple city of Kanchipuram.