How to connect my arduino to my phone even from across the country

Hi! I'm trying to get my Arduino to connect to my phone's custom app from MIT App Inventor. Currently, I'm using the HC-05 Bluetooth Module and the classic Bluetooth commands on MIT App Inventor. But this means that my phone can only connect to the Arduino when it's in range. I want to be able to connect to the Arduino from long distances, ideally across the country and even from the opposite side of the world. How can I accomplish this?

What do you want the Arduino to be doing? One solution would be to use an app like Home Assistant to manage the connection between a home smart hub and the Arduino. I don't know about other platforms but I do what you are describing via Apple Home -> Home Assistant.

First you need a WiFi board like ESP32 or ESP8266 with WiFi , connect the board to a WiFi in range.

Look at RemoteXY.

https://remotexy.com/

Bluetooth is only for a few feet. For 'anywhere' you need internet. In order to connect your phone to a device back home requires using very specific things in order to 'break' the natural security.
It can be done but before going there tell us morer about what you want to do in normal person speak, not using technical words as that pre-supposes a solution.

Please read information/data for BT. It's designed for 10 some 10 meter of distance.

Try Google for long distance communication.

Using the internet, or if internet is not locally available, satellite communications (requires a satellite modem and a clear view of the sky).

I have a soil moisture sensor to monitor a plant. I want the Arduino to communicate with the app about how well the plant is doing by sending soil moisture readings. Since the Arduino is indoors, I'm aware that furniture and walls might get in the way of connecting. Also, is there a specific app development platform that can be used and is compatible with Wi-fi modules?

Take a close look at Home Assistant.

Check here

Sounds like a job for Arduino cloud

If you want something free try this:

Usage is limited but it is FREE.

the best and most secure way is not free.

You would need to buy a subscription to an MQTT service from a provider (like AWS IoT Core, u-blox MQTT Anywhere/Now), have the ESP32 push data to an MQTT topic and have the phone as a topic subscriber (google MQTT client for your Android or IOS)

it is not difficult

self hosting the MQTT is doable but you need to open the firewall for the phone to connect to it which is a security risk and you also need to protect the MQTT endpoint against DDOS attacks (in the USA Cloudflare offers such protection for free).

Just as I typed the answer above I thought of a simpler, free solution: have the ESP32 send an email to your phone when needed. There is a library that can do this easily: ReadyMail by Mobizt (it is available in the library manager of Arduino IDE, current version 0.4.0

The Arduino Cloud product is secure and free for limited usage. It works pretty well.

I can see how much water my house has used or start watering my garden from anywhere in the world, using my phone to connect to the Arduinos and ESP32s I have running the systems.

I use an app called Pushover (pushover.net). My ESP8266 sends a POST command to the Pushover server, which then sends a push notification to the pushover app on my phone. The cost is a one-time lifetime charge of $5 for each receiving phone. But you might end up with too many notifications, so maybe it could send one per day, or when something unusual happens.