What is the relationship between deletion or insertion of nucleotide in the gene sequence and the protein's length that is coded out from the mutated gene?
It depends on the nature of the insertion or deletion.
Many mutations are point mutations, where one single nucleotide is changed:
ATGACTACGCTATTCAGT M T T L F S ATGTCTACGCTATTCAGT M S T L F S
Notice that changing the fourth A to a T caused a T->S change in the final protein, and didn't change its length. However, an insertion/deletion is different. Starting with this sequence:
ATGTCTATTGACGCTATTCAG M S I D A I Q
Let's have an insertion, an A after the A in position 7:
ATGTCTAATTGACGCTATTCAG M S N STOP
Notice we now have a stop codon (TGA). This means the protein will be truncated, and will be much smaller. That isn't always the case. Rather than adding an A at position 7, let's add it after position 9:
ATGTCTATTAGACGCTATTCA M S I R R Y S
The protein is about the same length, but the AAs are completely different than the original version after the insertion:
M S I D A I Q M S I R R Y S
This is called a frameshift mutation. Biologically, these mutations are harmful because they change all the amino acids after the mutation, the protein is often not functional and can end up being different sizes (if a stop codon is now in frame or out of frame) and the protein can even end up being unstable and rapidly degraded.
So, to answer your question about the length of the protein, it'll increase/decrease by one AA every time 3 nucleotides are added/removed, but can increase or decrease drastically if a stop codon is added or removed by a frameshift mutation.