The server has to run somewhere. It's like any other application you run. If it's running on your computer, then you turn off your computer, it doesn't keep running magically. If you run it on a laptop, and close the lid, it's going to disconnect all players as well.
If you want to turn off your computer, you'll have to host the server on some other computer which is always on, if you want your server to be always online.
You can alternatively look for a host, but you'll have to pay money for them to host a minecraft server for you.