We study the dynamical evolution of the gravitational-wave driven instability of the f -mode in rapidly rotating relativistic stars . With an approach based on linear perturbation theory we describe the evolution of the mode amplitude and follow the trajectory of a newborn neutron star through its instability window . The influence on the f -mode instability of the magnetic field and the presence of an unstable r -mode is also considered . Two different configurations are studied in more detail ; an N = 1 polytrope with a typical mass and radius and a more massive polytropic N = 0.62 model with gravitational mass M = 1.98 M _ { \odot } . We study several evolutions with different initial rotation rates and temperature and determine the gravitational waves radiated during the instability . In more massive models , an unstable f -mode with a saturation energy of about 10 ^ { -6 } M _ { \odot } c ^ { 2 } may generate a gravitational-wave signal which can be detected by the Advanced LIGO/Virgo detector from the Virgo cluster . The magnetic field affects the evolution and then the detectability of the gravitational radiation when its strength is higher than 10 ^ { 12 } G , while the effects of an unstable r -mode become dominant when this mode reaches the maximum saturation value allowed by non-linear mode couplings . However , the relative saturation amplitude of the f - and r -modes must be known more accurately in order to provide a definitive answer to this issue . From the thermal evolution we find also that the heat generated by shear viscosity during the saturation phase completely balances the neutrinos ’ cooling and prevents the star from entering the regime of mutual friction . The evolution time of the instability is therefore longer and the star loses significantly larger amounts of angular momentum via gravitational waves .