According to the media, Perez has an ultimatum of 2 GPs to keep his spot.
The media are always spreading rumours about Perez to be replaced in times he doesn't manage to show the expected performance. It is difficult to believe them about this as a result until hearing from Red Bull about it as well. However it is the truth that there have been many times Perez made the race extra difficult for himself.
But all in all Perez has still managed to keep second place so far. I think he is just the kind of a driver Red Bull would like now. Because they don't want to have another driver like Verstappen. I don't think Verstappen would want a teammate as competitive as him either. Helmut Marko says that there isn't any alternative for Perez now.