I visited the UK last year for two months. On my application, I stated that i was only going to visit for two weeks but I stayed longer than that, but I did not overstay. I read online that this may be grounds for refusal on my next application. Is this true? I would appreciate some clarification on this topic
Yes this is true. See a somewhat similar situation here although in his case he had a couple additional complications from taking too much leave/vacation time in the consular officers opinion.
It is not an absolute deal breaker however be prepared to explain why two weeks became two months, especially if you're a worker (two months is a lot of vacation for many countries) or a student whose school was not on vacation over that two month period.