This concept appears in a sermon for children from 1845, by Alexander Fletcher:
Oh! my young friends, how happy you shall be, when Christ enters into your heart! I should like every little child this afternoon, to present the following beautiful petition to Christ; it is a very remarkable one; but oh! He loves it. It is this: 'Oh! Jesus, enter into my heart. May Thy grace enter into the soul of a little child, there to dwell for ever.' (source)
The word ask does not appear, but the context makes it clear that the child is to make a "petition" to Christ using these words.
A similar version, this time a prayer following a sermon on Revelation 3:20, appears in 1878:
Then the good gentleman told him that he had only to pray, "Lord Jesus, come into my heart," and He would come and dwell with him for ever. (source)
More exact wording appears in 1931:
For kids, it's enough just to be a Christian, to ask Jesus into your heart. (source)
More generally, however, Google Ngrams shows that the exact phrase did not gain traction, at least in print, until the second half of the 20th century: