Yes y = 5x is a polynomial because any monomial is a polynomial.
A monomial is something where you have a variable, or collection of variables multiplied. The variables may or may not have exponents. Also, there is often a fixed coefficient as well. In this case, 5 is the coeffcient and x is the variable. So that's why 5x is a monomial.