I wrote a comment but I would like to expand a bit. First of all, the white and black keys are not major or minor by themselves. The black keys are simply some of the notes with single sharps or flats. So in C Major or Ionian, all of the white keys are in the scale. But A minor or Aeolian is also all white keys. A note can't be major or minor by itself- those qualities come from intervals: e.g. a major third is four semitones and a minor third is three semitones. Major vs. minor is more about the relationship between notes, not a quality of a note by itself.
As far as your question goes, I am assuming you are not talking about major and minor, and are just talking about distinguishing between the "white notes" and "black notes" on a keyboard, or the natural notes (C, D, E, F, G, A, B) vs. the notes with sharps and flats (C#/D♭, D#/E♭, F#/G♭, G#/A♭, A#/B♭). Technically the white keys can be represented with sharps and flats as well, e.g. D♭♭ is the same as C and F♭ is the same as E. People with perfect pitch would likely be able to distinguish between a C and a C# easily, because someone with perfect pitch can instantly identify any note they hear without context.
Most of us mere mortals have relative pitch though, so without context it would probably be difficult to tell if a note was a C or C#. Once you introduce context, it becomes easier to tell the notes apart. If you are playing in C Major/Ionian (which is all white notes), then any of the black notes will sound out of place.
Your last question about acquiring perfect pitch doesn't have an easy answer. Most people say that you can't learn perfect pitch after a certain age- it is usually children that are exposed to learning an instrument at a very young age that acquire perfect pitch (or in certain Asian cultures where the language relies more heavily on the pitch of the voice, so they are again exposed to distinguishing pitches at an early age). But consensus seems to be once you grow up (past adolescence), if you don't have perfect pitch you probably can't learn it.
What you can do is improve your ear and get good at identifying relative pitches. Relative pitch is a skill where you can identify the intervals between notes but without a reference pitch to compare them to you can't always be sure which notes are which. For example someone with relative pitch could hear two notes and be able to tell they are a perfect fifth apart, but they probably wouldn't be able to say "That's a C then a G," without any information about context. Another example would be someone with perfect pitch could sing their favorite song in the right key every time, without needing a reference note. Someone with good relative pitch would pick a note to start on, and would sing the song correctly (i.e. all the intervals would be right), but it might be in the wrong key if they didn't start on the right note.
For a practicing musician, relative pitch is an extremely useful tool. Perfect pitch isn't necessary to be a great musician.