Question: "How does God distribute spiritual gifts?"
Answer: Romans 12:3-8 and 1 Corinthians chapter 12 make it clear that each Christian is given spiritual gifts according to the Lord's choice. Spiritual gifts are given for the edification of the body of Christ (1 Corinthians 12:7, 14:12). The exact timing of the giving of these gifts is not specifically mentioned. Most assume that spiritual gifts are given at the time of spiritual birth (the moment of salvation). However, there are some verses that may indicate God gives spiritual gifts later as well. Both 1 Timothy 4:14 and 2 Timothy 1:6 refer to a gift that Timothy had received at the time of his ordination "by prophecy." This likely indicates that one of the elders at Timothy's ordination spoke about a spiritual gift that Timothy would have to enable his future ministry.
We are also told in 1 Corinthians 12:28-31 and in 1 Corinthians 14:12-13 that it is God (not us) who chooses the gifts. These passages also indicate that not everyone will have a particular gift. Paul tells the Corinthian believers that if they are going to covet or long after spiritual gifts, they should strive after the more edifying gifts, such as prophesying (speaking forth the word of God for the building up of others). Now, why would Paul tell them to strongly desire the "greater" gifts if they already had been given all they would be given, and there was no further opportunity of gaining these greater gifts? It may lead one to believe that even as Solomon sought wisdom from God in order to be a good ruler over God's people, so God will grant to us those gifts we need in order to be of greater benefit to His church.
Having said this, it still remains that these gifts are distributed according to God's choosing, not our own. If every Corinthian strongly desired a particular gift, such as prophesying, God would not give everyone that gift simply because they strongly desired it. If He did, then who would serve in all of the other functions of the body of Christ?
There is one thing that is abundantly clear—God's command is God's enablement. If God commands us to do something (such as witness, love the unlovely, disciple the nations, etc.), He will enable us to do it. Some may not be as gifted at evangelism as others, but God commands all Christians to witness and disciple (Matthew 28:18-20; Acts 1:8). We are all called to evangelize whether or not we have the spiritual gift of evangelism. A determined Christian who strives to learn the Word and develop his teaching ability may become a better teacher than one who may have the spiritual gift of teaching, but who neglects the gift.
Are spiritual gifts given to us when we receive Christ, or are they cultivated through our walk with God? The answer is both. Normally, spiritual gifts are given at salvation, but also need to be cultivated through spiritual growth. Can a desire in your heart be pursued and developed into your spiritual gift? Can you seek after certain spiritual gifts? First Corinthians 12:31 seems to indicate that this is possible: "earnestly desire the best gifts." You can seek a spiritual gift from God and be zealous after it by seeking to develop that area. At the same time, if it is not God's will, you will not receive a certain spiritual gift no matter how strongly you seek after it. God is infinitely wise, and He knows through which gifts you will be most productive for His kingdom.
No matter how much we have been gifted with one gift or another, we are all called upon to develop a number of areas mentioned in the lists of spiritual gifts: to be hospitable, to show acts of mercy, to serve one another, to evangelize, etc. As we seek to serve God out of love for the purpose of building up others for His glory, He will bring glory to His name, grow His church, and reward us (1 Corinthians 3:5-8, 12:31"14:1). God promises that as we make Him our delight, He will give us the desires of our heart (Psalm 37:4-5). This would surely include preparing us to serve Him in a way that will bring us purpose and satisfaction.