An EA can only work if your trading platform is connected to your broker, so yes, you have to be online.
If the EA is designed to also manage trades, it can not do so if it not online. You either need to leave your PC on, and trading platform open, or use a VPS. Many brokers offer free VPS service for live accounts.