Should be plenty of time. Lots of visitors report they can "do" the pyramids in 2 hours. Giza is only a few kilometers from the centre of Cairo, and the airport is within striking distance, but the traffic can get really bad, so don't leave your return to the airport too late.
Re guided or solo... have a read of this piece. The US embassy in Cairo is concerned about over-aggressive touts targeting solo travellers, not sure about the veracity of it, but worth taking into consideration.
Phil at the safety hub. about 5 years ago