I think 2 years is a nice standard, but it doesn't always need to be that long. I know people who've gotten married a year after they started dating and are still happy, as well as couple that were together 7 years or more before doing so. There's no set rule. I really believe you need to live together first though, because so many aspects of living together will determine whether you are truly compatible in the long term. Cleanliness, diet, finances....all these things will come into play and you'll get a real idea of whether each other's habits and preferences are in sync with the other's.
Live as if you were to die tomorrow. Learn as if you were to live forever. - Mohandas Gandhi