Nonlocality and entanglement are not only the fundamental characteristics of quantum mechanics but also important resources for quantum information and computation applications. Exploiting the quantitative relationship between the two different resources is of both theoretical and practical significance. The common choice for quantifying the nonlocality of a two-qubit state is the maximal violation of the Clauser-Horne-Shimony-Holt inequality. That for entanglement is entanglement of formation, which is a function of the concurrence. In this paper, we systematically investigate the quantitative relationship between the entanglement and nonlocality of a general two-qubit system. We rederive a known upper bound on the nonlocality of a general two-qubit state, which depends on the states entanglement. We investigate the condition that the nonlocality of two different two-qubit states can be optimally stimulated by the same nonlocality test setting and find the class of two-qubit state pairs that have this property. Finally, we obtain the necessary and sufficient condition that the upper bound can be reached.