
Certified GKH Gardening Expert
This will take about 2 years if it is given near perfect conditions. Typically, they won't flower well indoors if at all. You can do some things to give it a better chance. This will need to be placed under grow lights, or placed outside once it is warm enough. You will want to feed it, periodically, with a well balanced fertilizer of your choice. It will want a rich, light soil that remains slightly moist but not wet or dry. It will appreciate tropical conditions to keep it growing up to speed.
This article will help:
https://www.gardeningknowhow.com/special/children/planting-pineapple-tops.htm
This article will give you more information on the perfect growth parameters, which can be harder to achieve, but will reward you with a better harvest:
https://www.gardeningknowhow.com/edible/fruits/pineapples/care-of-pineapple-plants.htm