You need an equation system.
First, translate the text into equations :
y = total price for the bike
x = number of months
first bike :
y = 25x + 500
second bike :
y = 50x + 200
Then you have to solve the system by placing the two equations side by side and comparing them.
25x + 500 = 50x + 200
Solve to find the value of x