Yes, there will be male and female in heaven. We will still retain our physical gender. Jesus is our example of resurrection, and He retained His physical body (John 2:19-21; 1 Cor. 15:35-45). However, there will not be procreation nor will we be married to our spouses anymore. We this off of the resurrection of Christ.
"He is also head of the body, the church; and He is the beginning, the firstborn from the dead, so that He Himself will come to have first place in everything," (Colossians 1:18).
We see from this verse that Jesus is the "firstborn from the dead." This means he is the first one to be raised from the dead in a glorified, resurrected body. This is explained in the following verses.
"So also is the resurrection of the dead. It is sown a perishable body, it is raised an imperishable body; 43 it is sown in dishonor, it is raised in glory; it is sown in weakness, it is raised in power; 44 it is sown a natural body, it is raised a spiritual body. If there is a natural body, there is also a spiritual body," (1 Cor. 15:42-44).
So, we can conclude that we will follow in our resurrected bodies in the same way Jesus Rose with his. We see that he retained his crucifixion wounds and his gender.
"After eight days His disciples were again inside, and Thomas with them. Jesus came, the doors having been shut, and stood in their midst and said, “Peace be with you.” 27 Then He *said to Thomas, “Reach here with your finger, and see My hands; and reach here your hand and put it into My side; and do not be unbelieving, but believing," (John 20:26-27).
It was Jesus who appeared to Thomas. Jesus is a man, and Thomas recognized him. Therefore Jesus retained his gender after his resurrection. Furthermore, Jesus retained his crucifixion wounds further demonstrating he retained his physical characteristics.
So, we conclude that we will retain our gender when we are resurrected in our new glorified bodies and go to heaven. But, as I said at the beginning of this article, we will not be married nor will he have any need of procreation.
But, some might ask how this is possible since the Bible says...
"There is neither Jew nor Greek, there is neither slave nor free man, there is neither male nor female; for you are all one in Christ Jesus," (Galatians 3:28).
This verse is not saying there will not be male and female genders in heaven. It is saying that "in Christ" there is neither male nor female. "In Christ" designates representation and salvation. Gal. 3:28 is saying that when it comes to salvation, gender does not matter. In addition, the phrase "in Christ" designates a doctrine known as federal headship where the male represents the descendants. This is why we have verses such as...
"for as in Adam all die, so also in Christ all will be made alive," (1 Corinthians 15:22).
"In Adam" and "in Christ" are terms of representation. Adam represented all humanity and Christ represented his people.