For hints on cheap lenses, see
https://www.pentaxforums.com/forums/pentax-lens-articles/59245-pawnshop-lense...ers-guide.html
Lotsa good advice from previous responders. Now for more detail. Zillions of lenses are available to fit your K5. I only have 233 of them; it's a start. Pentax-made lenses come in a few series or lines, as follows:
* Takumars, maybe prefixed with Auto- or Super- or S-M-C- or Macro- or Tele-. Most Takumars are M42 screw-mount. These need a simple M42-PK adapter. Folks with only a few M42s should have an Official Pentax adapter, safe but not cheap. Those of us with many M42s buy a lot of cheap clone adapters, after taking precautions. They're not difficult to use buy you'll probably want to start with PK (bayonet-mount) lenses.
* Some Takumars, called Takumar Bayonet or Takumar-A or Takumar-F, are budget PK-mount lenses. They may be pretty decent, and fairly cheap, but aren't as well-liked as other sexier Pentaxi. They're similar to their K- or M-series kin, but lack advanced coatings for flare control. They're still better than much of the competition.
* All other Pentax bayonet lenses say SMC (super-multi-coated) on the front or body. These come in various lines of manual-focus (MF) and autofocus (AF) glass. The AF lenses will say SMC-F or -FA or -FA-J or -DFA (for full-frame cameras), or SMC-DA or -DA-L (for APS-C dSLRs -- these lack aperture rings and may vignette on full-frame cameras). All of these have electric aperture automation as well as autofocus. Manual-focus PK lenses come in these lines (chronologically):
-- K-series just say SMC with no series indicator. These have only manual aperture control.
-- M-series say SMC-M. They operate the same as K-series, but tend to be a bit smaller.
-- A-series say SMC-A. They have the same electric aperture automation as AF lenses.
The easiest MF lenses to start with are A-types. Third-party lenses for Pentax may be of any of the above types. A-types from any maker can be told by looking at the aperture ring -- if it has a position marked A or P, it's an A-type. (AF lenses have an A-position too.) It it's marked P, it's compatible with old Ricoh SLRs, and may be labeled as KR mount. WARNING: Some of those KR's contain the dreaded Ricoh pin, which may get stuck in a PK-AF mount and is a nuisance to remove. Avoid those at first -- stick to A-types.
A-type lenses allow aperture control from the camera, and you can use any exposure mode. K- and M-type lenses only have manual aperture control. On the main menu, set USING APERTURE RING to PERMITTED. Set your K5's exposure mode to M(anual) and press the Green button for metering and exposure. This isn't difficult but it's easy to forget, and A-types really are simpler to start with. Ah, but M-types tend to cost less. That's important for cheap bastards like me. I have about twice as many M-types as A-types 'cause those are what I can afford.
So, what lenses to look for? There are brands, and there are focal lengths. Are many decent A-type primes badged as Vivitar, Sigma|Quantaray, Tamron|Promaster, Tokina, Toyo|TOU, Sears, Focal, Zeiss, and of course Pentax. Samyang has a new series of A-type primes badged under various names; for new lenses, these are real bargains. But I like old cheap stuff.
The least expensive and most common focal lengths left over from film days are 50mm, 28mm, 135mm, 35mm, and 200mm. Note that on our dSLRs, 50mm is short tele, good for head+shoulder portraits; 35mm is long-normal, which some prefer; and 28mm is 'normal', close to the diagonal of the camera frame. I use 50s and 28s more than 35s and 40s. Your mileage may vary.
How to choose a focal length when buying a prime? Tape your kit lens to 24-28-35-45-55mm for a few days each and see where you're comfortable. Where would I start if I had to build a prime kit from scratch? Probably something like A-types at 50/1.7, 28/2.8, 135/2.8, 24/2.8, 90/2.8 macro, in that order. But it all depends on desire and budget. Have fun!