TL; DR Somewhere between now and a few hundred billion years time. (For a co-moving volume) Now read on.
If stellar remnants are included, then the answer is very far in the future indeed, if and when the constituents of baryons begin to decay. So let's assume that "stars" means those things that are undergoing nuclear fusion reactions to power their luminosity. Let's further assume that the stellar mass function, (N(m) is the number of stars per unit mass) we see in the neighbourhood of the Sun is representative of populations in all galaxies at all times (difficult to make a start, without assuming this).
The number of stars that have been born is equal to the sum over time (the integral) and over mass of N(m) multiplied by the rate at which mass is turned into stars in a comoving volume of the universe Φ(t).
We then need to subtract a sum over time and mass of the rate of stellar death in the same comoving volume. The rate of stellar death is the rate of stellar birth at a time t−τ(m), where τ(m) is the mass-dependent stellar lifetime. We ignore mass transfer in binary systems and assume that multiples can be treated as independent stellar components.
Thus the number of stars at time t is approximately
N∗(t)=∫t0∫mN(m)Φ(t′)−N(m)Φ(t′−τ(m)) dm dt′ .
To find where this is a maximum, we differentiate with respect to time and then equate to zero. i.e. We look for the time when the stellar birth and death rates are the same.
I was going to (and possibly still will) attempt some sort of analytic approximation, but Madau & Dickinson (2014) have done it better and taken into account the metallicity dependence of stellar lifetimes and the chemical evolution of galaxies. The star formation rate peaked about 10 billion years ago, is more than an order of magnitude lower now and is exponentially decreasing with a time constant of 3.9 billion years.
The integrated stellar mass is shown in their Fig 11 (shown below). It is still increasing today, but at a very low rate and has not passed through a maximum. The reason for this is that most stars have masses of 0.2-0.3 solar masses and lifetimes much longer than the age of the universe. Even if these stars are added at a very slow rate, their death rate is zero at present.
If star formation did continue at a low-level then the number of stars would only begin to significantly diminish once the stars near the peak of the stellar mass function, that were born at the earliest times, start to die. The lifetime of a 0.25 solar mass star is around a trillion years (Laughlin et al. 1997).
On the other hand if star formation ceased now then the number of stars would immediately begin to diminish.
Perhaps we could argue that the current exponential decline will continue and the peak
will come in another few billion years when stars of 0.8-0.9 solar masses begin dying off. However, that is futurology given that we have no first principles theory that explains the time-dependence of star formation, so I believe the best answer that can be given is somewhere between now and a few hundred billion years time.
Note that this answer assumes a co-moving volume. If the question asked is phrased in terms of the observable universe then because the number of stars has nearly reached a plateau, then the answer becomes close to whatever age the volume of the observable universe is maximised. I say "close to" because you have to factor in that the observable universe includes stars in distance slices at all cosmic epochs. I am unwilling to undertake this horrendous calculation, but note that the current concordance cosmological model has our observable universe slowly increasing from around a radius of 45 billion light years now, to about 60 billion light years in the far future Davis & Lineweaver 2005, and this may compensate for a slow decline in the number of stars in a co-moving volume.