Do you have a firewall configured that may be blocking it? I use ssh and sshfs to get into my Pinephone all the time and have had no problems. My firewall is configured to only allow incoming ssh connections from reserved LAN addresses (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) so I can ssh in from just about any LAN I'm connected to.
Does your wifi have AP isolation enabled? It would block connections between wifi devices.
Mobile data is even less likely to work, at least if using IPV4 addresses, since typically carrier-grade NAT is used on those connections. It would be like trying to connect to a home computer via IPV4 where you'd need port forwarding set up in the router. However you're not able to do that with carrier-grade NAT since it's under your service provider's control. (Even if using IPV6 depending how your carrier has that configured you may not be able to connect.)
For test purposes I would take it down to the simplest case on your home network, which is under your control, and see if you can connect.
Just a thought, did you set a non-standard port for sshd on the Pinephone? If so you'd need to specify the port in putty or use the "-p" option if running ssh client from the command line.