The capacity for biofilm formation is one of the crucial factors of staphylococcal virulence. The occurrence of biofilm-forming staphylococci in raw milk may result in disturbances in technological processes in dairy factories as well as the contamination of finished food products. Therefore, this study aimed to determine the prevalence and characteristics of staphylococcal biofilm formation in raw milk samples and to explore the genetic background associated with biofilm formation in those isolates. The material subjected to testing included 30 cow’s milk samples acquired from farms in the central part of Poland. A total of 54 staphylococcal strains were isolated from the samples, of which 42 were classified as coagulase-negative (CoNS) staphylococci belonging to the following species: S. haemolyticus, S. simulans, S. warneri, S. chromogenes, S. hominis, S. sciuri, S. capitis, S. xylosus and S. saprophyticus, while 12 were classified as S. aureus. The study examined the isolates’ capacity for biofilm formation and the staphylococcal capacity for slime production and determined the presence of genetic determinants responsible for biofilm formation, i.e., the icaA, icaD, bap and eno and, additionally, among coagulase-negative staphylococci, i.e., the aap, bhp, fbe, embP and atlE. Each tested isolate exhibited the capacity for biofilm formation, of which most of them (79.6%) were capable of forming a strong biofilm, while 5.6% formed a moderate biofilm, and 14.8% a weak biofilm. A capacity for slime production was demonstrated in 51.9% isolates. Most of the tested staphylococcal strains (90.7%) had at least one of the tested genes. Nearly half (47.6%) of the CoNS had the eno gene, while for S. aureus, the eno gene was demonstrated in 58.3% isolates. The frequency of the bap gene occurrence was 23.8% and 25% in CoNS strains and S. aureus, respectively. The fbe gene was demonstrated in only three CoNS isolates. The presence of the icaA was only demonstrated in CoNS strains (24.1%), while the icaD was found in both CoNS strains (21.4%) and S. aureus (100%). Among the CoNS, the presence of the embP (16.7%), aap (28.6%) and atlE (23.8%) was demonstrated as well. The obtained study results indicate that bacteria of the Staphylococcus spp. genus have a strong potential to form a biofilm, which may pose a hazard to consumer health.