"You might be on to something" is a phrase you would use in response to a good suggestion or a good idea that has an element of novelty or inventiveness to it.
It can be used in a lot of different senses and the precise wording can vary. For example, if your friend tells you about his really great business idea, you could respond "you might be onto something with that." In other words, you're saying that you think his business idea could be successful.
Another example would be if you're trying to work out how to do something and your friend makes a suggestion about another way to try to do it. If you think that doing what he or she has suggested could work, you could respond by saying "you could be onto something there".
However, as noted above, generally the phrase is used only in response to suggestions or ideas that have an element of novelty or inventiveness to them, i.e. they suggest something new. For example, if your friend suggests going to the cinema this weekend and you think that's a good idea, responding with "you might be onto something there" doesn't make sense, because the idea of going to the cinema isn't new or particularly inventive.