Searching for pairs of integers that satisfy primality and divisibility conditions
You are running into several performance problems.

First: if you want to generate a list of primes, you should use a sieve which is much more efficient.

Second: you are checking s+1 in primes, which is inefficient for a list. Instead you should make primes be a set, so that your lookup time is constant.
Third: Instead of for s in range(2, t**2 + 1):, you should use for s in range(floor(t**.5), t**2 + 1):, as this prevents wasting time checking values where s^2&lt;t.

Between these two changes you should see a pretty large speed boost.