A "bar" in a rap song is simply one line in the song, thus counting bars only requires the counting of the lines. Suggesting a rapper has bars as a positive compliment derives from the fact that a rhyme cannot be created from one line, but rather requires multiple lines.
Just as poetry is divided into lines and stanzas, rap songs measure the same things using bars and verses. In displaying a bar in text, a forward slash is typically used to denote the conclusion of a bar. There is no predetermined length of a bar beyond what can be understood as one line, usually creating a rhyme with the following bars.