There are a lot of people who are not sure about when Lord Ganesha actually starred to become mentioned. Some even debate about this because no one knows the absolute beginning of Hinduism. It seems the Lord Ganesha has already appeared in some ancient scriptures.
The first-ever reference can be found in the Rig Veda wherein it starts with the invocation of Lord Ganesha. Take note that Lord Ganesha is also known as the Chief of Divine Beings also known as Ganas. He is also the chief of Supreme Seers. Based on the scriptures, it will be safe to say that Lord Ganesha has been present for a long time according to the Rig Veda.