Most cribs are now very federally regulated for safety. If you are buying a new crib it's almost always going to adhere to those safety standards so you can feel pretty comfortable doing that. The old drop side cribs which aren't really sold anymore as new cribs but those have generally been deemed unsafe so I would avoid those. What I usually tell people is if you're going to get a used crib, to look it up. There is a consumer safety website and if you look that up, it'll let you know if it's been recalled and if so, then you can contact the manufacturer if there's any safety updates that you need to do for that crib.
When you are preparing your crib it's a good idea to keep these points in mind. The mattress is firm and tight fitting so that the baby cannot get trapped between the mattress and the crib. If you can fit more than two fingers between the mattress and the side rails, the mattress is too small. There are no missing, loose, broken or improperly installed screws, brackets, or other hardware on the crib and mattress support.
Crib slats are no more than two and three eighths inches apart. This is about the width of a soda can and that there are no missing or cracked slats that might allow a baby's body to fit between them. The corner posts are at the same height as the end panels or not more than one sixteenth of an inch higher so the baby's clothing cannot catch. There are no cut outs in the headboard or footboard that could trap babies head.
Some crib safety measures to keep in mind. Do not place a crib near a window. Drapery cords pose a strangulation risk and screens cannot keep a climbing toddler from falling out of an open window.
Avoid placing large toys or pillows in a crib. They can boost a toddler up enough to climb out of the crib.
Never place cushions, quilts, or comforters in the crib. Such items can cause a child to suffocate.
Use only a fitted sheet specifically made for crib use. Never use a plastic bag as a mattress cover. The plastic film could suffocate the child.
Remove mobiles and crib gyms once baby reaches five month old.
Once baby can sit without help, be sure to lower the floor of the crib. Once baby is able to stand, lower the floor of the crib to its lowest position. Remove anything that might aid in climbing out.
As a general rule I would say most kids are ready to move out of their crib around age two. Certainly if your child is very active and adept at climbing out of their crib on their own, it's probably a good idea to move them to a toddler bed or a small child's bed.