I'll offer a Latter-day Saint's perspective.
That which persuades one to believe in Christ comes from God
The prophet Mormon specifically addressed how to know what comes from God, and what does not, in a sermon that was recorded by his son Moroni. He offers the standard that things which persuade to believe in Christ and to love God come from God.
(Note that he is speaking to an audience that already has a working understanding of the role & identity of Christ as well as His Gospel--this standard would obviously be less useful if one lacked this)
13 But behold, that which is of God inviteth and enticeth to do good
continually; wherefore, every thing which inviteth and enticeth to
do good, and to love God, and to serve him, is inspired of God.
14 Wherefore, take heed, my beloved brethren, that ye do not judge
that which is evil to be of God, or that which is good and of God to
be of the devil.
15 For behold, my brethren, it is given unto you to judge, that ye
may know good from evil; and the way to judge is as plain, that ye
may know with a perfect knowledge, as the daylight is from the dark
16 For behold, the Spirit of Christ is given to every man, that he may
know good from evil; wherefore, I show unto you the way to judge; for
every thing which inviteth to do good, and to persuade to believe in Christ, is sent forth by the power and gift of Christ; wherefore ye
may know with a perfect knowledge it is of God.
17 But whatsoever thing persuadeth men to do evil, and believe not
in Christ, and deny him, and serve not God, then ye may know with a
perfect knowledge it is of the devil; for after this manner doth the
devil work, for he persuadeth no man to do good, no, not one; neither
do his angels; neither do they who subject themselves unto him.
Latter-day Saints understand the "spirit of Christ" referenced here, as defined elsewhere in scripture, to be the "light of Christ" or conscience that is granted to every person. This is distinct from the power or the gift of the Holy Ghost. Everyone has a conscience to provide a basic inclination of good vs. evil (though one can certainly dull one's conscience by ignoring it long enough).
Honest vs. dishonest messengers
The prophet Joseph Smith taught the following, intriguing standard for determining if the appearance of a spiritual messenger comes from God or not (this may indirectly address part of the OP's question about visions):
4 When a messenger comes saying he has a message from God, offer him
your hand and request him to shake hands with you.
5 If he be an angel he will do so, and you will feel his hand.
6 If he be the spirit of a just man made perfect [i.e. a good person
who hasn't been resurrected yet] he will come in his glory; for that
is the only way he can appear—
7 Ask him to shake hands with you, but he will not move, because it is
contrary to the order of heaven for a just man to deceive; but he will
still deliver his message.
8 If it be the devil as an angel of light, when you ask him to shake
hands he will offer you his hand, and you will not feel anything; you
may therefore detect him. (Doctrine & Covenants 129:4-8)
To recognize the fake, you have to know the real thing
How could we possibly expect to recognize a counterfeit (anything) if we are unfamiliar with the real thing? God is willing to teach us to recognize the Holy Ghost, and to communicate to us in a manner that we can understand:
For my soul delighteth in plainness; for after this manner doth the Lord God work among the children of men. For the Lord God giveth light unto the understanding; for he speaketh unto men according to their language, unto their understanding. (2 Nephi 31:3)
He also predicates revelation upon our asking with a sincere heart & real intent (see Moroni 10:4), and does not give us more than we are ready to handle (see John 16:12, Doctrine & Covenants 82:3). Rather, He teaches line upon line, precept upon precept (see Isaiah 28:10, 2 Nephi 28:30).
The Pearl of Great Price relates an account of Moses, after beholding a glorious vision from God, being approached by Satan who sought to deceive him. Because Moses had received clear, glorious revelation from God, he readily recognized that was Satan was offering was a fraud (see Moses 1:4-15).
King Benjamin offered a great key to coming to know Christ:
For how knoweth a man the master whom he has not served, and who is a stranger unto him, and is far from the thoughts and intents of his heart? (Mosiah 5:13)
In the same chapter he teaches that if we will make the covenants God requests of us, take upon ourselves the name of Christ, and keep Him in our remembrance and focus, we will come to know His voice (see Mosiah 5:8-12)
- That which persuades one to believe in Christ comes from God; the devil will never try to persuade us to believe in Christ. As we grow in our knowledge of Christ and His Gospel, this metric becomes more and more useful
- Ministrants from God will not seek to deceive
- We need to do the spiritual work to come to recognize the voice & inspiration of God; in so doing, we will know a counterfeit when we see it
As with everything in our eternal journey, it's a process:
24 That which is of God is light; and he that receiveth light, and continueth in God, receiveth more light; and that light groweth brighter and brighter until the perfect day. (Doctrine & Covenants 50:24)