This is probably the most common myth in the world of training, and a question I get asked all the time. The answer is NO! Fat CANNOT turn into muscle nor can muscle turn into fat.
You may ask, so why the weight gain?
So let's go back to the original question: does muscle turn into fat? You have to understand what is fat and what is muscle.
Our muscles are tissues that contract to produce movement in our body and to support other structures in our body (joints, internal organs etc).
Fat however, is a tissue that stores energy for emergency usage (in cases of hunger or starvation).
There is no connection between these two types of tissues. They are made up of different cells and have different functions. When we do strength exercise, the calories go to building and strengthening our muscles. When we stop exercising, the opposite occurs; the muscles weaken and get smaller, and the extra calories that our body does not need are stored as fat in different areas in our body.
So don't get confused! When you exercise it's important to understand the effects of what you are doing, and what is happening in your body. Better understanding leads to better results!