Every TLS certificate has an expiry date, the "not after" field. Once it passes, browsers refuse to connect. You can look it up in the browser, with openssl, or online.
In the browser
Click the padlock or site settings icon next to the address, open the connection or certificate details and look for Expires on or Valid until. Keep in mind this is the certificate your browser got, which might be your CDN's and not your server's.
With openssl
This connects to the server, prints the certificate's end date and exits:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
| openssl x509 -noout -enddate
You get something like notAfter=Mar 3 12:00:00 2027 GMT. Don't leave out -servername. A server
with several sites picks the certificate by name (SNI), and without it you can end up looking at the wrong one.
For scripts, -checkend takes a number of seconds and exits with 0 if the certificate is still valid by then, 1 if not. 30 days:
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
| openssl x509 -noout -checkend 2592000
For a certificate file on disk
openssl x509 -in /etc/letsencrypt/live/example.com/cert.pem -noout -enddate
That's the file on disk, not necessarily what's being served. If the web server wasn't reloaded after a renewal, they won't match.
Online
The certificate check does one host, the bulk check up to 10. Both connect from outside your network, so you see what visitors see.