How soon should you mention that you are looking for something serious leading to marriage without sounding like you want to rush things but also to avoid wasting your time if that's not something they are looking for in the future?
I think the first bridge that needs to be crossed is determining if you actually like someone enough to date them exclusively. We're so fixated on not being led on or being used that we don't focus on what's in front of us. This is one reason why so many people end up in bad or toxic relationships. We miss the red flags because our attention is diverted elsewhere.
I understand the desire to optimize your time, but gauging true or even potential compatibility requires investing time you will never get back. That's just a reality of dating. The fear of wasting your time is a logical fallacy, because the large majority of time we devote to dating results in no return on investment.
Once a pattern develops - you see each other a set number of days a week, talk regularly, weekends are delegated to seeing one specific person, etc - that's when it's time to have this conversation. This could happen after a couple of weeks or a couple of months. The length of time you've been seeing each other isn't relevant so much as the consistency. Here are some other suggestions about having "the talk."
1. Pick a time when you're in a groove and both of you are in good spirits.
2. Have this conversation face-to-face. This way, so you can see their reaction and so you get a genuine response. This will also help avoid the anxiety of waiting for a reply to a text or email, which could make the discussion go south very quickly.
3. Don't ask if you and they can have a serious conversation or talk about something. You don't need permission to express a thought. Simply drop into conversation that you're dating with intention of finding a long-term relationship. Maybe it's with them or maybe it isn't, but you're not dating aimlessly or casually. Explain that you wanted to make that clear before the relationship progressed.
4. Don't bother asking them what they're looking for. Most people, when they feel they've been backed into a corner, will say whatever they think will cause the least amount of conflict.
5. Let them respond however they choose. They are allowed to pause or seem uncertain. What you should watch out for is ambivalence or uncertainty about their end goal. It's okay if they say they're enjoying getting to know you and are taking their time in determining the nature of the relationship. However, if they say they're not looking that far ahead or don't see themselves getting serious any time soon, you have your answer. Most people are decent and will be as honest as they can be in that moment.
6. Most importantly: be prepared to walk away. It is when you are certain you can leave a situation with little regret that you should broach this topic. That's why excuses like, "I don't want to waste my time" don't ring true to me. If you're willing to stick things out undefined for the foreseeable future, you clearly have no problem wasting your time.
I hope that helps.