from kepler's second law, it is known that the planet sweeps out an equal area in equal time intervals
therefore, a planet has the largest velocity, and hence the highest kinetic energy when passing by the perihelion (closest to the star), and the lowest potential energy
also, it will have the lowest kinetic energy when passing by the aphelion (furthest away from the star, and the highest potential energy