That's John's account of Jesus words after the passover and not to be confused with suicide in any way. Jesus knew how much his disciples loved him, he was comforting them, breaking it to them that he wasn't going to be around much longer and that even if he wasn't with them physically that they shouldn't lose faith.
Ealier he had said to them: "I say unto you, Except a corn of wheat fall into the ground and die, it abideth alone: but if it die, it bringeth forth much fruit."
He was explaining his fathers purpose which would involve giving up his life for the good of mankind. He was also preparing them for the times to come and warning them that they (his disciples) would be persecuted for their beliefs as he had.
The bible does not condone suicide or purposely sacrificing ones life for any person.