Cooking a turkey depends on many different factors including the size of the turkey and the temperature of the turkey when you place it in the oven. Use a meat thermometer to check the temperature of the bird as you cook and check to be sure that the temperature is around 165 degrees and not much more or it will be overcooked.
As a rough guide, baking at 325 degrees, a 12 pound turkey will cook for 3 hours, a 16 pound turkey will cook for 4 hours and a 24 pound turkey will cook for 5 hours. Using a convection oven will shorten the times dramatically and cooking a stuffed turkey will lengthen the cooking times by about half an hour. Be sure to use a thermometer to get the internal temprature of the turkey as it cooks.