In these lecture notes we shall study first the supersymmetric quantum mechanics (SUSY QM), specially when applied to the harmonic and radial oscillators. In addition, we will define the polynomial Heisenberg algebras (PHA), and we will study the general systems ruled by them: for zero and first order we obtain the harmonic and radial oscillators, respectively; for second and third order PHA the potential is determined by solutions to Painlevé IV (PIV) and Painlevé V (PV) equations. Taking advantage of this connection, later on we will find solutions to PIV and PV equations expressed in terms of confluent hypergeometric functions. Furthermore, we will classify them into several solution hierarchies, according to the specific special functions they are connected with.