user3784: Based on the following link:  https://en.bitcoin.it/wiki/Wallet_import_format , a private key of 256 bits gets transformed into a WIF address that is stored in the wallet.
However, my question here is how did we convert step 6 into step 7? In step 6, the address consists of 74 hexadecimals characters (or 74*4= 296 bits). If we convert this 296 bits address using the code58, we need to divide 296 bits by 6.. ? I believe that some details are not mentioned, any ideas?

user18196: You're basically wondering how Base58 encoding works. This site gives a good overview but I will list the details here as well with a more concrete example. For this example, I'll just talk about the encoding, but the version byte (prepended) and checksum bytes (appended) do get added before this encoding is done. This prepending/appending just changes the base data before encoding. The below is how the data gets encoded.
Let's say I have this simple encoding called Base4 encoding. In my encoding:

  0->A
  1->B
  2->C
  3->D

If I have the number 134 (1000 0110 or 0x86) and I want to encode it in Base4, then what I do is repeatedly divide by 4 and use the encoding. Like so:


134 / 4 = 33 remainder 2 -> C
          /
   -------
  |
 33 / 4 =  8 remainder 1 -> B
          /
   -------
  |
  8 / 4 =  2 remainder 0 -> A
          /
   -------
  |
  2 / 4 =  0 remainder 2 -> C

So the Base4 encoding for this byte would be "CABC". Bitcoin does the same thing, but using 58 numbers instead of 4, and a different character for each. The characters chosen in the Base58 encoding are just to avoid confusion when humans transpose the key. For example, there is no I character, because there is already a 1 character, and the two could be confused really easily.
There's just one more thing that's a little tricky. If I were encoding the data 0x0086, I might want the encoding to be slightly different than the above encoding for 0x86 to show that I had an extra 0x00 byte at the beginning. To do this, all you do is add extra data at the left side of the encoding. So, in our Base4, 0x0086 is encoded as ACABC. Similarly 0x0000 0086 is encoded as AAACABC. In standard bitcoin addresses, the version byte prefix is 0x00, and 0x00 is encoded as a 1, so addresses always start with a 1.

user24796: StephenM347's answer is very good, but there is one little detail he got wrong. I'd post this as a comment to his answer, but I don't have enough reputation.
Stephen said:

For example, there is no O character, because there is already a 0
  (zero) character, and the two could be confused really easily.

The wiki says: 

A set of 58 alphanumeric symbols consisting of easily distinguished
  uppercase and lowercase letters (0OIl are not used)

A lowercase "o" is used, but the uppercase "O" and the number "0" are both excluded from base 58.

user50627: Here's an example of how to create a WIF with a private key using Python. It follows the docs and I've commented the code to make it enough to follow.
import binascii, hashlib, base58

# alias method
decode_hex = binascii.unhexlify

# wallet import format key - base58 encoded format
def gen_wif_key(private_key):
    # prepended mainnet version byte to private key
    mainnet_private_key = '80' + private_key

    # perform SHA-256 hash on the mainnet_private_key
    sha256 = hashlib.sha256()
    sha256.update( decode_hex(mainnet_private_key) )
    hash = sha256.hexdigest()

    # perform SHA-256 on the previous SHA-256 hash
    sha256 = hashlib.sha256()
    sha256.update( decode_hex(hash) )
    hash = sha256.hexdigest()

    # create a checksum using the first 4 bytes of the previous SHA-256 hash
    # append the 4 checksum bytes to the mainnet_private_key
    checksum = hash[:8]
    hash = mainnet_private_key + checksum

    # convert mainnet_private_key + checksum into base58 encoded string
    return base58.b58encode( decode_hex(hash) )


3784: <p>Based on the following link:  <a href="https://en.bitcoin.it/wiki/Wallet_import_format" rel="nofollow">https://en.bitcoin.it/wiki/Wallet_import_format</a> , a private key of 256 bits gets transformed into a WIF address that is stored in the wallet.</p>

<p>However, my question here is how did we convert step 6 into step 7? In step 6, the address consists of 74 hexadecimals characters (or 74*4= 296 bits). If we convert this 296 bits address using the code58, we need to divide 296 bits by 6.. ? I believe that some details are not mentioned, any ideas?</p>
 18196: <p>You're basically wondering how Base58 encoding works. <a href="https://en.bitcoin.it/wiki/Base58Check_encoding" rel="nofollow">This site</a> gives a good overview but I will list the details here as well with a more concrete example. For this example, I'll just talk about the encoding, but the version byte (prepended) and checksum bytes (appended) do get added before this encoding is done. This prepending/appending just changes the base data before encoding. The below is how the data gets encoded.</p>

<p>Let's say I have this simple encoding called Base4 encoding. In my encoding:
<pre>
  0->A
  1->B
  2->C
  3->D
</pre>
If I have the number 134 (1000 0110 or 0x86) and I want to encode it in Base4, then what I do is repeatedly divide by 4 and use the encoding. Like so:</p>

<pre>
134 / 4 = 33 remainder 2 -> C
          /
   -------
  |
 33 / 4 =  8 remainder 1 -> B
          /
   -------
  |
  8 / 4 =  2 remainder 0 -> A
          /
   -------
  |
  2 / 4 =  0 remainder 2 -> C
</pre>

<p>So the Base4 encoding for this byte would be "CABC". Bitcoin does the same thing, but using 58 numbers instead of 4, and a different character for each. The characters chosen in the Base58 encoding are just to avoid confusion when humans transpose the key. For example, there is no I character, because there is already a 1 character, and the two could be confused really easily.</p>

<p>There's just one more thing that's a little tricky. If I were encoding the data 0x0086, I might want the encoding to be slightly different than the above encoding for 0x86 to show that I had an extra 0x00 byte at the beginning. To do this, all you do is add extra data at the left side of the encoding. So, in our Base4, 0x0086 is encoded as ACABC. Similarly 0x0000 0086 is encoded as AAACABC. In standard bitcoin addresses, the version byte prefix is 0x00, and 0x00 is encoded as a 1, so addresses always start with a 1.</p>
 24796: <p>StephenM347's answer is very good, but there is one little detail he got wrong. I'd post this as a comment to his answer, but I don't have enough reputation.</p>

<p>Stephen said:</p>

<blockquote>
  <p>For example, there is no O character, because there is already a 0
  (zero) character, and the two could be confused really easily.</p>
</blockquote>

<p><a href="https://en.bitcoin.it/wiki/Base58Check_encoding" rel="nofollow">The wiki</a> says: </p>

<blockquote>
  <p>A set of 58 alphanumeric symbols consisting of easily distinguished
  uppercase and lowercase letters (0OIl are not used)</p>
</blockquote>

<p>A lowercase "o" is used, but the uppercase "O" and the number "0" are both excluded from base 58.</p>
 50627: <p>Here's an example of how to create a WIF with a private key using Python. It follows the docs and I've commented the code to make it enough to follow.</p>

<pre><code>import binascii, hashlib, base58

# alias method
decode_hex = binascii.unhexlify

# wallet import format key - base58 encoded format
def gen_wif_key(private_key):
    # prepended mainnet version byte to private key
    mainnet_private_key = '80' + private_key

    # perform SHA-256 hash on the mainnet_private_key
    sha256 = hashlib.sha256()
    sha256.update( decode_hex(mainnet_private_key) )
    hash = sha256.hexdigest()

    # perform SHA-256 on the previous SHA-256 hash
    sha256 = hashlib.sha256()
    sha256.update( decode_hex(hash) )
    hash = sha256.hexdigest()

    # create a checksum using the first 4 bytes of the previous SHA-256 hash
    # append the 4 checksum bytes to the mainnet_private_key
    checksum = hash[:8]
    hash = mainnet_private_key + checksum

    # convert mainnet_private_key + checksum into base58 encoded string
    return base58.b58encode( decode_hex(hash) )
</code></pre>
