Legally it is not, assuming you are above the age of 18. It is however a rather irresponsible course of action as at that age you have not figured out what you want to do career wise and you also have not grown as a person.
It's an irresponsible thing to do. You don't even really know who you are as a person - and even though you may have some insight, you still need to understand you have a lot more to learn than just the basics from high school. There is a huge difference in thinking you are mature, and actually being mature; something a lot of people, especially those young, get mixed up. I honestly think you should be with somebody for 7+ years before thinking about marriage; allow the relationship to grow and start on a very solid level of ground with each other. People overlook the small things in life - and this is especially true when in a relationship; your mind becomes clouded with thoughts that will never see the light of day at such an age.