Delhi and Agra need about 4 - 5 days. Spend 2 - 3 days in Delhi seeing old buildings like the Red Fort and Qutub Minar. Also visit India Gate and Humayun's Tomb. Check out the busy markets in Chandni Chowk and Connaught Place too.
Spend 1 - 2 days in Agra to see the famous Taj Mahal, Agra Fort and Fatehpur Sikri. This gives you enough time to enjoy the main sights in both cities without rushing. You will be able to explore comfortably and take in the highlights.
For an easier trip, think about getting a Delhi Agra Tour Package. These usually cover travel, guides and hotels. This way, you can relax and enjoy your visit without stressing about planning details. It is a simpler way to see the sights.