A ceiling fan chain that needs to be replaced should be the length necessary for the shortest person in the household to comfortably reach it while standing on the floor.
For the most part this is based on the height of your ceiling and who you want to operate it. If you have children and want them to be able to turn it on you may want to make it longer. Generally 2 to 3 feet is a good length.