There are two primary ways that sola fide theologians deal with this issue, and there is ongoing debate between them over it (cf. Lordship salvation controversy). I'll first address the historical view (sometimes called "Lordship salvation") and the more recent view, called "free grace theology."
Lordship salvation
The name commonly applied to this view emphasizes that following Christ is not merely a matter of intellectual belief, but also accepting him as Lord and therefore turning away from the sin nature. Thus its adherents see repentance and faith as inherently connected; as Wayne Grudem says, they are "two different sides of the same coin" (ST, 714) Louis Berkhof writes:
True repentance never exists except in conjunction with faith, while, on the other hand, wherever there is true faith, there is also real repentance. The two are but different aspects of the same turning, — a turning away from sin in the direction of God. (ST, 4.7.D.3)
Thus the two cannot be separated. Where they are distinguished (as in Calvin, Institutes, 3.3.1; see curiousdannii's answer), the one necessarily follows the other, and thus in all cases faith is the only basis for the justification of the sinner.
Berkhof and Grudem are both Reformed theologians, as is John MacArthur, the author of the book The Gospel According to Jesus, which extensively defends this view. But their analysis is shared by other Protestant traditions. For example, Arminian John Miley writes:
While faith is the one and only condition of justification, yet a true repentance is always presupposed, because only in such a mental state can the proper faith be exercised. An impenitent soul cannot properly trust in Christ for the forgiveness of sin. (Systematic Theology, II, 323)
Lutheran John Mueller, summarizing Francis Pieper's work, uses the word contrition instead, but sees the two as synonyms in this sense:
The two essential elements in conversion are contrition and faith [...] Contrition belongs to conversion only for the reason that faith cannot find entrance into the proud and secure heart; it is "the indispensable preparation for conversion." (Christian Dogmatics, 338)
Repentance here is not assumed to be perfect or complete repentance, but rather a general turning away from sin. Continued growth in faith and repentance is an important aspect of the Christian's sanctification, but a failure to perfectly repent of every sin does not lead to a loss of salvation.
Free grace theology
This view's name reflects its adherents' belief that repentance is a "work" that is not required for salvation – thus grace is more "free" than in a scheme were repentance and faith are aspects of conversion. According to this view, intellectual faith alone, without any turning from sin, is sufficient for salvation.
In recent times the view is most commonly associated with evangelicals influenced by dispensationalism; Wayne Grudem identifies Lewis Sperry Chafer as its originator. In Major Bible Themes, Chafer writes:
The Scriptures are violated and the whole doctrine of grace confused when salvation is made to depend on anything other than believing. The divine message is not "believe and pray," "believe and confess sin," "believe and confess Christ," "believe and be baptized," "believe and repent," or "believe and make restitution." (Chapter 28)
Bob Wilkin, founder of the Grace Evangelical Society, expounds:
There is no commitment, no decision of the will, no turning from sins, and no works that are part of faith in Christ. If you are convinced or persuaded that what He promised is true, then you believe in Him. Faith is passive. It is simply taking Jesus at His word.
Thus turning from sins, commitment, obedience, and perseverance are not faith and thus aren’t conditions of eternal life. Those are all types of works. Works have their proper place in the Christian life, but only after you have believed in Jesus. (source; emphasis in original)
Thus for the free grace theologian, repentance is distinct from faith and therefore comes after (and not necessarily immediately after) conversion and justification.
Summary
Thus we see two views in the sola fide camp with respect to this question. Both agree that perfect repentance is not a requirement for salvation, but the majority view holds that in conversion faith and repentance are inseparable, though only faith is the basis of justification. The "free grace" view holds that faith and repentance are distinct, with the latter being a work that is done after justification is accomplished.