Okay, there are a couple of topics here. Raspberry runs at 3.3 Volts. We do not want to apply 5V signals to a 3.3V device, as that will most likely break it. (Nevermind the actual voltages are rarely 0-3.3 or 0-5, we'll pretend for worst case as if they were.)
So one issue is "do we have 5V signals to deal with?", another issue is, "assuming we do, how do we handle that?".
First off, Raspberry isn't software architected for real time stuff, as it's running a linux. So using it to do RT stuff is a bit iffy. But suppose we were to go that route, so Raspberry is to look at these encoder signals directly.
The encoder is almost certainly just an LED/phototransistor interrupter, turned on and off by a small plate attached to the motor shaft, two channels so it's quadrature style. It's most likely designed for 5V operation, but *it may work fine at 3.3*. The way to find that out is hook it up to a power supply at 3.3, look at the outputs with a scope, see what's there. That'll at the same time tell you if your encoder is working.
If it works at 3.3, you're good, you can run those signals directly to the Pi. It would be better to buffer them with, say, a Schmitt trigger, but that's good engineering practice; this is amateur night, so no worries.
If it does not work at 3.3, but does work at 5, then some level shifting is in order. A simple resistor divider would do, 2/3 ratio would work fine.
A side note: people here are subject to Hammer Syndrome. "To a man with a hammer, everything looks like a nail". So you will often ask a question whose answer is "a resistor will fix that" or "you need one transistor there" and people will say "you could probably do that with an arduino..." This is true, and as 'duinos are so cheap now, you can in fact get away with it. It's, however, somewhat akin to cracking walnuts by driving over them with your car. It works, and might be a sensible field expedient, but is a silly way to do it routinely. A nutcracker or hammer makes more sense most of the time. But arduino runs at 5V and can be configured to output 3.3V signals as there are 3.3V shields on the market. Hence, a multimillion gate ultraversatile microprocessor on its own PCB really can be used to do the work of a resistor and/or a counter chip. And it may even be the easiest or quickest way to do this, as there may be more people at hand who know how to work with arduinos than know what to do with a transistor. Just don't assume there's some sophisticated reason that's the best solution, okay?
An all around better approach would be to use external circuitry to track the motor position, so the real time deficiencies of the Pi are unimportant. A simple quadrature decoder can be made from up/down counter IC's, trivial stuff. But you may not have heard of this, because it's the sort of thing known to classically trained EEs, and rarely mentioned in how-to's which are themselves written by amateurs. Not your fault they don't talk about these things, as they don't know the basics, either. We can discuss the principles of that approach if you are interested.
A final comment, as I may be misreading a comment above: while sometimes people get away with powering an LED or some such directly from a Pi, arduino etc output pin, don't plan on that. Don't plan on powering anything but maybe the base or gate of a transistor from those. Those are signal pins, not power devices. Always power your devices from the system rail, not from a signal line.
Did any of that clarify matters any?