What will happen, if I add a program in both inbound and outbound rules in windows? Is it necessary to add a program in both inbound and outbound rules in order to completely block the program from the network, or only outbound rule is enough?
Outbound rules apply to connections made by that program to the outside world. On most systems, programs can make whatever outbound connections they want as long as there's not an explicit deny in place. Inbound rules apply to sockets that the program is attempting to listen for connections on. By default, inbound connection attempts are blocked unless explicitly allowed.
Therefore, creating an outbound block will probably do the job, but it can't hurt to add an inbound explicit deny also.
Caution! Malicious programs can do bad things to your computer even without network access; firewalling them off will not stop them from causing damage. Sufficiently privileged programs can simply disable or reconfigure the firewall. If you're trying to examine an untrusted program, consider a virtual machine instead.