A while back I was telling a friend who was tired of meeting people and going out a couple times only to find out that they weren't aligned with what they were looking for that they needed to just be open and communicate what they wanted to get out of the relationship that was forming. They said to me, "But what if that scares people away?"
I said, "Anyone who gets 'scared' away by you being open and honest about what you're looking for was never going to end up with you anyway, and you just saved you and them some time."
If all you're looking for is someone to have a good time with, there's nothing wrong with that, but you just need to be honest about it; conversely, if you're hoping to find someone and build a life together, better to be upfront about it rather than start to make a life only to find out they weren't looking for anything that serious.
Now, this shouldn't be what you say the instant you meet (i.e. "Hi, I'm Bob, and I'm only looking for someone to have fun with!" or "Hello, I'm Angela, and I want to be a mom in the next 3 years.") but it should definitely come up by the time you get to the dating/hanging out stage.
And yes, things can change. You may have started out just having fun together, but you both grew closer than you had thought you would; or, you could have started out building a life together but after a few years you realize that's not what you want anymore. These can be very difficult conversations, but they should be had to make sure everyone is aware of what the other is putting into the relationship. We can't read minds (and how horrible would it be if we could!), so the next best thing is communication.