When the electron moves away from the nucleus, it's potential energy is decreasing. Potential energy is inversely proportional to the square of the distance. PE has a negative sign due to negative charge on an electron. So as the electron moves away from nucleus, the magnitude of PE decreases and its sign becomes less negative. Far away from the nucleus, we can say the electron is free and its PE is then zero.