The scripts linked at /etc/rc0...6.d/ have numbers at the begining right after the letter S/K, so the question is what is order of execution? From the lower to higher or higher to lower? I also would like to know if there is any rules on these number, can I create a script with number 1, 2, ..., 97, 98, or only some specific numbers are allowed?
I'd like to run a script after the system boot and before the system shutdown, but as those scripts needs internet connection to perform its tasks at which runlevel folder should I place it?
They're run low to high. Here's a good TLDP page on runlevels in general.
You can use whatever number you like. They're sorted by number to give some systems prioroty over others. These are loaded sequentially. It's not event-driven like Upstart.